LAB 54: bash SHELL-FIRST SCRIPT

 <  Day Day Up  >  

LAB 54: bash SHELL ”FIRST SCRIPT

  1. Write a script called greetme that will do the following:

    1. Contain a comment section with your name, the name of this script, and the purpose of this script.

    2. Greet the user .

    3. Print the date and the time.

    4. Print a calendar for this month.

    5. Print the name of your machine.

    6. Print the name and release of this operating system ( cat /etc/motd ).

    7. Print a list of all files in your parent directory.

    8. Print all the processes root is running.

    9. Print the value of the TERM , PATH , and HOME variables .

    10. Print your disk usage ( du ).

    11. Use the id command to print your group ID.

    12. Print Please, could you loan me $50.00?

    13. Tell the user Good-bye and the current hour (see man pages for the date command).

  2. Make sure your script is executable.

     chmod +x greetme 

    What was the first line of your script? Why do you need this line?

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net