Problem scenario
How do you insert a string with forward slashes using a perl command like this?
perl -i -pe ‘s/.*/Hello World/ if $.==15’ foobar.txt
This command would insert “Hello World” on the 15th line of the text file named foobar.txt. Instead of “Hello World” you want something else inserted that happens to include forward slashes (“/”). You want to identify a line in a file by its line number.
…