Monday, May 6, 2019

Most important SED syntax

This is how Unix SED was meant to be used.

Take a text file and substitute 1 regex match for a new one, in place.

My file:
-rw-r--r-- 1 matt matt  7338 May  6 00:05 merge.rb


sed -i s/OLDVALUE/NEWVALUE/g merge.rb


-i means in-place
-s means substitute
-g means globally

No comments:

Post a Comment