Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I ONLY NEED HELP WITH PART C BUT YOU NEED PART A TO DO C, THANK YOU. . Start vim

ID: 3887786 • Letter: I

Question

I ONLY NEED HELP WITH PART C BUT YOU NEED PART A TO DO C, THANK YOU.

. Start vim to create a new file named pizza.  [Nothing to submit]

2. Type i (lowercase i for input) to put vim in Input mode and enter the following text, pressing RETURN at the end of each line. Ignore typing mistakes you make for now. Press ESCAPE when you are done typing to put vim back in Command mode.  [Nothing to submit]

Pizza is an oven-baked, flat, round bread

typically topped with a tomato sauce, cheese

and various toppings. Pizza was originally

invented in Naples, Italy, and the dish has

since become popular in many parts of the world.

3. Use the ARROW keys to move the cursor so that it is over the o in originally. Press the x (delete character) key ten times to delete each of the letters in originally. The editor should remain in Command Mode throughout this step.  [Nothing to submit]

4. Search for the word Italy by first pressing the / (forward slash) key. Pressing this key puts vim in Last Line mode; the cursor moves to the bottom line of the screen. Now type Italy and press RETURN to search for the word Italy. Delete the word Italy by giving the command dw (delete word). The comma and the following SPACE remain. You could remove them using the x command, but this step introduces a different command.  [Nothing to submit]

Before you can try removing Italy another way, you must restore the word you just deleted. Type u (undo) to undo the last command you gave; Italy reappears. Whereas dw deletes a word but not adjacent punctuation, dW deletes the word including adjacent punctuation. Give the command dW.  [Nothing to submit]

5. The ? (question mark) searches backward for a string of characters the same way the / searches forward. Search backward for the word topped by typing ?toppedfollowed by RETURN. The cursor is now on the t in topped.  [Nothing to submit]

6. The cw (change word) command removes a word and puts vim in Input mode so you can type a word to replace the original one. You must press ESCAPE to return vim to Command mode when you are finished typing the new word. With the cursor on the first letter of topped, give a cw command and type the word coveredfollowed by an ESCAPE. [Nothing to submit]

7. The o (open) command opens a blank line below the line the cursor is on, moves the cursor to the new line, and puts vim in Input mode. The O command works the same way except it opens a line above

the one the cursor is on. With vim in Input mode and the cursor on a blank line, you can enter as many lines of text as you like. When you are done, press ESCAPE to return vim to Command mode. Give an H (home) command to move the cursor to the first letter of the document you are editing. Give an O command to open a line above the document and type the title PIZZA followed by a RETURN and an ESCAPE. [Nothing to submit]

8. Save your work and exit from vim by giving the command ZZ. If the ZZ appears in the document, vim is in Input mode. Press ESCAPE to put vim back in Command mode, use the x command and ARROW keys to remove the ZZ, and give another ZZ command. [Submit the final results of your pizza file)

PART C

Write a single bash shell script to accomplish the following steps. If you are having difficulty [Show your work]

Step 1: Stating with the practice file that you create in part A, write a script that calculates the number of words in the file. Remember, in general, scripts are meant to be portable, so be sure to use absolute paths when possible.   

Step 2: Then divide the result of Step 1 by the current day of the month.

Step 3: Multiple the result of step 2 by your parent bash shell process identification number.

Explanation / Answer

Options

- | -s Suppress all interactive user feedback. This is useful when processing editor scripts. -l Set up for editing LISP programs. -r List the name of all files saved as the result of an editor or system crash. -r filename Edit filename after an editor or system crash. Recovers the version of filename that was in the buffer when the crash occurred. -L Same as -r -R Readonly mode; the readonly flag is set, preventing accidental overwriting of the file. -S This option is used in conjunction with the -t tag option to tell vi that the tags file may not be sorted and that, if the binary search (which relies on a sorted tags file) for tag fails to find it, the much slower linear search should also be done. Since the linear search is slow, users of large tags files should ensure that the tags files are sorted rather than use this flag. Creation of tags files normally produces sorted tags files. See ctags for more information on tags files. -t tag Edit the file containing the tag tag, and position the editor at its definition. -V Verbose mode. When ex commands are read by means of standard input, the input will be echoed to standard error. This may be useful when processing ex commands within shell scripts.