This really was an excellent way to learn sed commands. Thank you.
I like the braces vs -e. Any problems with that, std wise.
This:
-- sed -e :a -e 's/^.\{1,78\}$/ &/;ta'
verses:
-- sed '{:a; s/^.\{1,78\}$/ &/; ta}'
If it's something I'm keeping I put the commands on separate lines and use # comments at the end of the line for each command, as necessary. The opengroup doc says, "Ignore the '#' and the remainder of the line", so I think modern sed is okay. I'm using gnu sed, and no errors, but s2p didn't like them.
Over at grymoire.com sed tutorial, his examples showed a space between the address/range and the command, and for some reason, visually that helped.
This:
-- sed '/start/,/stop/ s/#.*//'
verses:
-- sed '/start/,/stop/s/#.*//'
This really was an excellent way to learn sed commands. Thank you.
I like the braces vs -e. Any problems with that, std wise.
This:
-- sed -e :a -e 's/^.\{1,78\}$/ &/;ta'
verses:
-- sed '{:a; s/^.\{1,78\}$/ &/; ta}'
If it's something I'm keeping I put the commands on separate lines and use # comments at the end of the line for each command, as necessary. The opengroup doc says, "Ignore the '#' and the remainder of the line", so I think modern sed is okay. I'm using gnu sed, and no errors, but s2p didn't like them.
Over at grymoire.com sed tutorial, his examples showed a space between the address/range and the command, and for some reason, visually that helped.
This:
-- sed '/start/,/stop/ s/#.*//'
verses:
-- sed '/start/,/stop/s/#.*//'
Reply To This Comment