Question: Perform this lab in linbox (class server)see Resources &Links for login info. You may need to review Scripting Assignments #1, #2, and / orScripting chapter

Perform this lab in linbox (class server)—see Resources &Links for login info.

You may need to review Scripting Assignments #1, #2, and / orScripting chapter / assignments.

Part I

  1. In your home directory, make a new directory calleddir1.
  2. Go into dir1 and use the touch command tocreate the following files:

apple, banana, carrot, date, egg,fish, grape, ham.

  1. List the contents to verify that you have all 8 files
  2. Open your favorite text editor, and create a shell scriptcalled Wildcards.sh
    1. Include this remark: “This script will include wildcards.”
    2. Have your script clear the screen.
    3. Have your script change into the dir1 directory.
    4. Have the script state, “The contents of dir1are: ”
    5. Have your script use a wildcard to display the files on thesame line.
  3. Save and exit. Verify that the script is present.
  4. Make the script executable, then run it.
  5. If your script does not execute successfully, troubleshootuntil it does.
  6. Include a screen scrape of the results of your scriptexecution.

The contents of dir1 are: apple bananacarrot date egg fish grape ham

glenn_jones@linbox:~$

Part II

  1. Make a copy of your script named Wildcards_part2.sh in the samedirectory.
  2. In your home directory, make a new directory calleddir2.
  3. Edit your new script to append the following to the end of thescript:
    1. Have it go back into the home directory: cd..
    2. Have it use a wild card to copy all of the files in dir1 todir2.
    3. Have it change into the dir2 directory.
    4. Have the script state, “The contents of dir2are: ”
    5. Have your script list the files on the same line.
  4. Save and exit. Run the script, and include a screenscrape of the results.

The contents of dir1 are: apple bananacarrot date egg fish grape ham

The contents of dir2 are: apple bananacarrot date egg fish grape ham

glenn_jones@linbox:~$

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!