I have a big text file (URL.txt) and I wish to perform the following using a single sed command:
Find and replace text 'google' with 'facebook' between line numbers 19 and 33.
Display the output on the terminal without altering the original file.
I have a big text file (URL.txt) and I wish to perform the following using a single sed command:
Find and replace text 'google' with 'facebook' between line numbers 19 and 33.
Display the output on the terminal without altering the original file.
the above answer ALMOST worked for me on Mac OSX.
sed '19,33s/google/facebook/' file
worked perfectly without braces.
sed '19,$s/google/facebook/' file
works until the end of the file as well.