Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with starting a command from script 2

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
When I run below command from root command line it starts properly ingres and monitor.ksh:

[ -d /home/ingres ] && (( su - ingres -c 'export II_GCNws_SVR_RESET=TRUE;iistartup -s' ) ; ( su - monitor -c /usr/scripts/monitor.ksh ))


But when I add the same line to a *ksh script the ingres doesn't start with an error:

/usr/scripts/global_script.ksh[41]: iistartup: not found

(but the monitor.ksh starts properly)


The global_script.ksh is executed by root.

Does anyone know what is wrong?

Thx in advance.
regards,m.






 
In ksh double brackets (( are used for arithmetic. Maybe try putting a space between them.
 
You need to set the PATH in the script to include where iistartup is. Or specifiy the entire path in the script.

When you execute root's command line, the PATH includes the directory where iistartup is. When it is executed in a script, you have to specify the PATH environment or always use the entire path to any command you use in the script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top