1.The file /usr/dict/words contains a long list of words in the English language, one per line, arranged into alphabetical order. This file is normally used as the dictionary for spell checkers. Suppose you were working a crossword puzzle and needed a 6-letter word beginning with ‘b’ (upper or lower-case) and with a lower-case ‘e’ as its third letter. What grep command would you use to list the words from /usr/dict/words that match this requirement?

2.You are part of a team working on a large program. The source code for this program is kept in the directory ~cs252/Assignments/commandsAsst/project. After a certain amount of debate, the team has decided to change the order of the parameters of the function sequentialInsert. Someone else is actually changing the definition of that function. Your job is to find all the places where that function is called and to make repairs as necessary. What command would you give to list all calls to that function? You should show the lines of code containing each call and the name of the file from in which each such line occurs. (It’s OK to produce a few incidental uses of the function name as well, because you will be inspecting the output before actually making the changes.)3. Same problem, but suppose that all you wanted was a list of the file names in which the function was mentioned?

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *