There is a file with this simple content:
projectA-app1
projectA-app2
projectA-app-mobile
projectB-app1
Now I need to get every application name into one line (removing line breaks)
apps=$(cat file.txt| tr -s '\n' ' ')
but I also need to remove all applications, which are ending with -mobile. How do I do that?
The result of this example should be
projectA-app1 projectA-app2 projectB-app1
echo $(grep -v "-mobile$" file.txt| tr \\n \ )grep -v "-mobile$" file.txt|xargsLook forxargsabout merging lines