Next: The Environment
Up: Shell Commands
Previous: Shell Commands
- The set command
Can be used to produce a list of currently defined shell variables
(see section )
Can be used to assign values to the positional parameters
(see section )
Can be used to set options for the shell:
set -v for example tells
the shell to echo each subsequent command before it is executed - The Do-Nothing Command: :
The colon is the shell's do-nothing command
It can have arguments, which, though the command doesn't do anything
about them, themselves can do something
Example:
: $DEBUG? 'Variable DEBUG not defined. Exiting...'
will cause the script to terminate, if the variable DEBUG isn't defined - The dot command: .
The command .commandlist reads and executes commands contained in
the file commandlist. The two differences between the dot command
and a standard shell script are:
- The dot command does not create a new subshell
- The dot command does not allow command line arguments
Note: A script executed via the dot command can change the value of shell
variables in the current shell! - The export command
export can be used to export the value of a variable to a
subshell
export without arguments prints out all variables that are already
exported - The shift command
The shift command shifts the positional parameters: $2 to $1,
$3 to $2 and so on...
Note: $1 is lost!!!
Roger Hampel
Mon Feb 2 09:39:25 MET 1998