9.3.10 eval command (concatenates arguments into a command and executes it)
Syntax
eval [command [args ...]]
Description
This command concatenates arguments into a command that it executes. The character strings provided as the arguments are interpreted as a single command that is executed.
Arguments
- command
Specifies a name for the command that is to be executed. If this argument is omitted, the eval command terminates normally but without executing anything.
- args
Specifies the arguments that are to be concatenated into a command and executed.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
127 |
Error termination
|
Other than the above |
Error termination
|
Notes
The execution results of this command are not output to the job execution log. Note also that this command does not identify whether the job or job step terminated normally or with an error. Refer instead to the execution results of the command that was called.
If the command syntax of this special built-in command is invalid, it exits the shell that is executing the command.
Example
Change directories to /home/adsh/script.
eval cd /home/adsh/script