I have the following text file contents:
/fubar/bob
/fubar/harry
/fubar/harry-
/fubar/steve
/fubar/tim
/fubar/tim-
/fubar/atim
/fubar/atim-
/fubar/jane
I am using sed to remove all lines containing references to harry, tim and atim.
sed -i 's#/fubar/\(harry\|tim\|atim\)\(\-\?\)##' /input/testfile.txt
This gives me the following output:
/fubar/bob
.
.
/fubar/steve
.
.
.
.
/fubar/jane
Where the .
doesn't actually exist, just using them to represent blank space in the file structure. Is there a way to adjust the sed statement so that it will remove the blank space in one line or will I need a second sed statement to do this? I can't seem to find anything online that combines the blank space removal with another function.