Applicable versions and levels
Solaris versions: 5.0 or later
Linux versions: 5.2, V10.0L10 or later
Linux for Itanium versions: V12.0L10 or later
HP-UX versions: 5.1 or later
AIX versions: 5.1 or later
DS versions: V20L10
Action
Points to check
Has the command name been obtained using the shell variable $0?
Cause
5.0 to 10.1
Systemwalker Operation Manager copies the script file to the spool, and the copied file is started using the specified full path. For this reason, the full path is set in the shell variable $0 in the script file.
11.0/12.0
If Copy the scripts specified when registering jobs before execution is selected in the Backward compatibility tab of the Define Operating Information window, Systemwalker Operation Manager copies the script file to the spool, changes the name of the copied file to "job number", and starts the file using the specified full path. For this reason, the full path containing the "job number" in the file name is set in the shell variable $0 in the script file.
If this is not selected, Systemwalker Operation Manager directly starts the script file. For this reason, the file name specified in Command in the Standard information tab of the Monitor - Job window is set as is in the shell variable $0.
Action method
5.0 to 10.1
To extract only the command name part in $0, consider using the basename command.
Script example (sample.sh)
#! /usr/bin/csh echo `basename $0`
11.0 or later
Consider an operation in which Copy the scripts specified when registering jobs before execution is cleared in the Backward compatibility tab of the Define Operating Information window. Note that, to extract only the command name part in $0, consider using the basename command, as mentioned previously.