Create a shell script

Project.

Due on week14

 

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

Problem:         Your assignment is to prepare a script that would accumulate your username, date and time, and your computer information into a log file. Then, as the part two, a case statement should be used in a loop to run several choices. Also, make sure an exit point must be provided in the script as well.

 

Instructions: Perform the following tasks:

Part 1

  1. Login into your bash shell.
  2. Create a shell script named yourname-script that would do:
    1. redirect a string Student name is <your actual first and last name> into a file Log-file; (10 pts)
    2. append the current date and time information to the file Log-file; (10 pts)
    3. append the string “My terminal logical name is <your actual logical terminal name>” to the file Log-file; use the command tty. (10 pts)
    4. learn the name of your machine using the command uname and append the string “My machine name is <the actual name>” to the file Log-file; (10 pts)

Part 2

    1. read the input from the keyboard; (5 pts)
    2. make the following selections: (50 pts)
  • if this is choice one,
    1. display the string ‘My files’ ;
    2. perform the listing command on your directory;
    3. append the result to the file Log-file;
  • if this is choice two,
    1. display the string ‘My directory’ ;
    2. perform the viewing of current directory command ;
    3. append the result to the file Log-file;
  • if this is choice three,
    1. display the string ‘Calendar of this month is <actual information using command cal>’ ;
    2. append the result to the file Log-file;
  • in all other choices,
    1. display the string ‘Wrong choice’ ;
    2. append the result to the file Log-file;
  1. Make the script yourname-script executable and run it. (5 pts)
  2. Submit your project. Use screen shouts for the results.