A shell is a program that provides an environment for users to interact with the system. Shell programs are files that contain a series of user commands that are grouped, using logic provided by the shell, to accomplish a task.
Shells can be defined by you, the script’s programmer, your agent administrator, and your UNIX administrator. When you define a job that runs on UNIX, you may want to know which shell is used to run the script because different shells have different facilities and characteristics. Some functions are specific to certain shells and may be incompatible with other shells.
The shell used is determined by the following settings in the following order:
Notes:
Example: Specify the Shell in the SHELL Statement
In this example, the C shell is specified in the SHELL statement.
AGENT UNIX_LA SCRIPTNAME /mfg/test1.csh SHELL /bin/csh
Example: Specify the Shell in the First Line of the Script
The first line of the following test1.csh script identifies the C shell:
#!/bin/csh -f if ( $LOGNAME != guest) then
echo "User is not guest"
endif echo $LOGNAME logon exit 0
The following job definition does not contain the SHELL statement:
AGENT UNIX_LA SCRIPTNAME /mfg/test1.csh USER guest
In this example, agent UNIX_LA runs the test1.csh script using the C shell.
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|