cs104 lab10 find, grep, egrep, sed (vim) I FIND There is a file "signature.html" somewhere in ~cs104/WWW. Use the find command to display the path to it. Get rid of the "no permission" error messages. Use find to show a path to all files in ~cs104/WWW ending in ".txt." HINT: If you just use *, it might immediately expand to all .txt files in the current directory. What is the difference between find . -name "*" and ls -R ? Write a small script "summary" that uses find to print the name (full path) and first line of all files below the given directory (shortened output): % summary ~cs104/labs/lab2 .../cs104/labs/lab2/misc/cats/catfile.txt : The file in ~cs104/labs/lab2/misc/cats .../cs104/labs/lab2/misc/dogs/dogfile.tst : The file in ~cs104/labs/lab2/misc/dogs /home/course/cs104/labs/lab2/sec1/s13a.csv : file s13a /home/course/cs104/labs/lab2/sec1/s14a.csv : file s14a [many lines cut] /home/course/cs104/labs/lab2/sec2/stuff.txt : file stuff.txt in sec2 .../labs/lab2/info.txt : cs104 S04, lab 2 more UNIX, *?[] .../labs/lab2/snail.dat : This file begins with an "s", for the end of part II II (E)GREP Use grep to print the line from ~cs104/WWW/grades.html with only your scores. Use grep to print the name of labs containing the WORD "html". HINT: grep does not do a find, you will need to list every file you want to search (lab4/info.txt ... ) on the command line. *'s will help. Find the option to print only the filename. Files for an imaginary class have been created named sec1, sec2 and sec3, with imaginary student usernames. Files named hw1 and hw2 have been created with the times each student turned in that homework (we used something like this to keep track of 227/228 homework.) Write a script "noturnin" which takes one input, the homework file, and lists the usernames of students who did not turn in that assignment: Ex: %noturnin hw1 scoobied daphne bart homer byron HINTS: Use a _for_ to look at all students in any sec (wildcards.) If grep'ping for that name says "", they didn't turn it in. Use egrep on the file junk.txt to find lines with these in them: o "home" followed anywhere by "loan" (Ex: home improvement loan) o Same thing, but upper/lower case (HOme LoaN.) HINT: there is a dash option. o "big savings", "biiiiiig savings", ... -- one or more i's in big o ice, but not words with ice in them (not mice, ricen.) o The first thing on the line is "loan" o last letter on the line is t III SED (substitution) [for these, always use the -r option] Use sed to print junk.txt with "loan" replaced with "new mortgage" (check the "babbog" line.) Replace all biiig's (with 1 or more i's) with huge. In the file bigs.txt, change biiig with 2-4 i's to huge, 5-10 to enormous and 10+ i's to stupendous. HINT: try them each separately, then use a big pipe. Use sed to add "] " to the start of each line (try it with just any file.) Use sed to delete the 1st 10 letters of each line (cut works better, but we'll need this for below) HINT: change "start-of-line""10 things" to nothing.) Add " | " between the 10th and 11th letter of each line. HINT1: Same as what you just did, but change the // (replace with nothing) to use a back-reference to the 10 things you just matched. Add " | " every 10 letters, not just after the first 10 (so we get size-10 columns.) HINT: this looks harder, but is what you just did with part of it removed. Use editor vim on hw5.cpp, which I've copied from a friend, and make these changes (each is one substitute command) so I won't get caught when I turn it in: Add an extra space after each comma ("int i, int j" becomes "int i, int j"). C++ comments start with // and go to the end of the line. Delete them (assume there will not be any //'s in quotes, where they wouldn't count.) Change each variable i (not part of a word) to num1 (in other words, don't change "right" to "rnum1ght", but change "i=6;" to "num1=6;".) HINT: the same way you found "ice" not in a word.