|
Hello John,
QSH CMD('CD /vendordir;iSstartServerCmd.sh') Either will work. The semi-colon is used to let you concatenate multiple QSH commands on one line.
Just an FYI to John or anyone else who may not know... Yes, you can use the semi-colon to separate multiple commands, but it'll run both commands, even if the first one fails. In this case, it probably doesn't matter, since if the /vendordir doesn't exist, you PROBABLY won't have a iSstartServerCmd.sh script in your current directory, so no harm would come of it.
However, consider this: QSH CMD('cd /tpm; rm dailySales.csv')In this case, I intended to go to the /tmp directory and delete dailySales.csv, but I accidentally typed '/tpm' instead of /tmp. Now the CD command will fail, but it'll still try to delete dailySales.csv! If I happen to have a file with that name in my current directory (very possibly an important file that shouldn't be deleted!) I'll delete it, even though the CD command failed.
Therefore, I recommend that you do this: QSH CMD('cd /tpm && rm dailySales.csv')Using && to separate the two commands means that it'll only run the RM command if the CD command succeeded.
Also, you can do the following if you like (though it's less useful from CL programs):
QSH CMD('cd /tpm || echo "Directory not found"')In this case, I used || to separate the commands. The ECHO command will only be run if the CD command *fails*... so it provides a way to detect errors and react to them.
But... the really useful one is &&...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.