sed help
echo "test start random stuff in here finish test" | sed -e 's/start*finish//'
echo "test start random stuff in here finish test" | sed -e '/start/,/finish/d' I want to delete from start to finish. The result should be "test test". |
The first line is missing a symbol right before the asterisk and after the "t". Right now you have it matching any number of the letter "t", since in regular expressions the asterisk works on the preceding symbol. It does not in and of itself match anything, like it would in globbing.
Hint: https://www.rexegg.com/regex-quickstart.html#morechars |
Quote:
The second line you are using a sed range (/pattern1/,/pattern2/) and the d command which is for delete. Use this when you want to remove a range of lines, starting from the first occurence of pattern1 until the first occurence of pattern2. |
All times are GMT -5. The time now is 08:42 PM. |