Operation Manual
when a tool is localized, it uses the language from this envi-
ronment variable. English can also be set to C
LANG
the search path of the shell, a list of directories separated by
colon
PATH
species the normal prompt printed before each command
PS1
species the secondary prompt printed when you execute a
multi-line command
PS2
current working directory
PWD
the current user
USER
22.5.1 Using Argument Variables
For example, if you have the script foo.sh you can execute it like this:
foo.sh "Tux Penguin" 2000
To access all the arguments which are passed to your script, you need positional param-
eters. These is $1 for the rst argument, $2 for the second, and so on. You can have
up to nine parameters. To get the script name, use $0.
The following script foo.sh prints all arguments from 1 to 4:
#!/bin/sh
echo \"$1\" \"$2\" \"$3\" \"$4\"
If you execute this script with the above arguments, you get:
"Tux Penguin" "2000" "" ""
22.5.2 Using Variable Substitution
Variable substitutions apply a pattern to the content of a variable either from the left
or right side. The following list contains the possible syntax forms:
Bash and Bash Scripts 349










