Write the following bourne shell scripts which perform the following actions.

1. Copy the file ~smcgowan/Cyber/Unix/Data/cards and write a bourne shell (/bin/sh) script that will grep it for the name "Mantle" (case INsensitive). If the grep finds any matches, output them to standard output. If there are no matches use echo to write a message to standard output that states that. (NOTE: The bourne shell does not assign a special meaning to the ~ character)

2. Write a bourne shell (/bin/sh) program that will test for the existence of a regular file. If it exists, output a line that states that. If it does not exist, echo a line that states that and touch the filename to create it. The program should accept the filename being tested as a positional parameter.

3. Copy the file called list from ~smcgowan/Cyber/Unix/Data. Write a bourne shell (/bin/sh) program that will accept a file name as a positional parameter and simply echo the values contained within that file to standard output in a single column.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

if grep -i "Mantle" /users/students/dhenr170/cards; then

This is only a preview of the solution. Please use the purchase button to see the entire solution


or $1 if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats