sd
sd copied to clipboard
How to replace if the string is on a certain line number?
How to replace if the string is on a certain line number? For example, Replace foo with bar only on the 4th line. in sed the command looks like: sed -i '4s/foo/bar/g' file
Did you find any solution to this, going through the repository I do not think this is implemented right?
Unfortunately no. However, you can replace a line in a file using:
sudo sd "<U005F> IGNORE;IGNORE;IGNORE;<U005F> % LOW LINE" "<U005F> <RES-2>;IGNORE;IGNORE;<U005F> % LOW LINE" /usr/share/i18n/locales/iso14651_t1_common