sed substitution conditional
on lines beginning with echo, globally substitute text with subtext:
sed '/^echo/s/text/subtext/g'
ok, i got that. what i want to do is to wrap ^echo into a not! conditional:
sed '/!(^echo)/s/text/bustext/g'
wondering what the syntax would be to make it like that... i can exclude based on the first character:
sed '/^[^e]/s/text/bustext/g'
but then lines beginning with en, etc., are also excluded. i would like to be able to exclude based on a pattern at the beginning of a line, not just a character. i've tried lostsa syntactical? combinations, nothing seems to work... thanks.
|