FLOPPIX | Home | FAQ | Download | Labs | ToC | Back | Next |
A bash script is a file containing a list of commands to be executed by the
bash shell.
The very simplest scripts contain a set of commands that you would normally
enter from the keyboard. For example: the following lines are stored in the
scripts colorme.
#! /bin/bash
# script to turn the screen blue
setterm -background blue
echo It is a blue day
Line 1: specifies which shell should be used to interpret the commands in
the script.
Line 2: is a comment (has no effect when the script is executed).
Line 3: sets the background colour.
Line 4: displays a message.
To run the script:
Method 1:
Test your script using your own username. Then, login on another console
as floopy, switch back to your own console and make sure that your script
displays the correct data about floopy.
To test your script, you should create some subdirectories, some files that are zero length using touch and some files that are not zero length using vi, redirection or cp.
Copyright © L.M.MacEwan
FLOPPIX | Home | FAQ | Download | Labs | ToC | Back | Next |