You want to edit 44 files so that every file name that is used inside them is change to a new one. For example: all the chapter numbers in our book changed and so all the file names changed... and so all the URLs had to change as well. I used the following sed script [ update.sed ] [ update.sed ]
You need to make the same small substitution in a lot of places in a very large file. Like I need to change "biuld" to "build" in most of my files!
Tou want to make your HTML web pages from simple ASCII text files.
(PostIt Note): 34.24
(why): 34.01 34.16
(exam): 34.01 34.02 34.04 34.05 34.09 34.10 34.14
(useful): 34.01 34.02 34.04 34.05 34.06 34.07 34.08 34.09 34.10 34.14 34.19 34.21 34.22 34.23
(perhaps): 34.11 34.12 34.13 34.15 34.17 34.18 34.20
Its all in the book!
I use sed all the day.
Do not use 'sed' like the following:
sed commands <myfile >myfilebecause it empties myfile first and then reads the empyt file...
Use ed to change a file or use a temporary file:
sed commands <myfile >tmpfile && mv tmpfile myfile
How do you output a file cutting off the characters that preceed a pattern using sed?
sed 'c.*pattern/' file?
sed 's/.*pattern//' file?
sed 's/*pattern/' file?
sed 's/.*\(pattern\)/\1/' file?
How do you cause sed to print only lines which do not match a specified pattern?
sed '/pattern/!p' file?
sed -n '/pattern/!p' file?
sed -n '/pattern/!p/' file?
None of the above.?
How do you substitute the word "UNIX" for the word "Windows" in a text file?
sed 'g/Windows/UNIX/' file?
sed -n 's/Windows/UNIX/gp' file?
sed 's/Windows/UNIX/g' file?
sed 'g/Windows/s//UNIX/g' file?
A(n) ____ is used by the stream editor to select lines for editing.
You were working on a paper, getting ready to edit it and replace 150 occurences of the misspelled word 'answear' with the correct spelling. Suddenly, your monitor fails! It powers down, and your visual connection to the digital world is lost!! And worse yet the paper has to be turned in in an hour! Blind as a bat and with the keyboard as your only connection to the computer, what can you do that will correct the spelling errors so that you can mail the paper in on time?