The Bash Shell Lab Exercises

Lab 1—First Script

  1. Write a script called greetme that will:

    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 couldn't 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 ...

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.