1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Bash Guide For Beginners

By


   Bash Guide for Beginners
   Prev    Chapter 2. Writing and debugging scripts    Next

2.5. Exercises

This exercise will help you to create your first script.

  • Write a script using your favorite editor. The script should display the path to your homedirectory and the terminal type that you are using. Additionally it shows all the services started up in runlevel 3 on your system. (hint: use HOME , TERM and ls /etc/rc3.d/S* )

  • Add comments in your script.

  • Add information for the users of your script.

  • Change permissions on your script so that you can run it.

  • Run the script in normal mode and in debug mode. It should run without errors.

  • Make errors in your script: see what happens if you misspell commands, if you leave out the first line or put something unintelligible there, or if you misspell shell variable names or write them in lower case characters after they have been declared in capitals. Check what the debug comments say about this.


   Prev    Home    Next
   Summary    Up    The Bash environment


* License

* Bash Guide For Beginners Index

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.