The TC Shell Lab Exercises

Lab 1—First Script

  1. Write a script called greetme that will:

    1. Greet the user.

    2. Print the date and time.

    3. Print a calendar for this month.

    4. Print the name of your machine.

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

    6. Print all the processes you are running.

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

    8. Print " Please couldn't you loan me $50.00? "

    9. 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
    
  3. What was the first line of your script?

Lab 2—Getting User Input

  1. Write a script called nosy that will:

    1. Ask the user's full name—first, last, and middle name.

    2. Greet the user by his or her first name.

    3. Ask the user's year of birth and calculate ...

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.