If you want to have do_test return and continue running in the script at the point where do_test was called, you need to check the exit status of each call to run_cmd (such as you showed in the code you don't like, by separating calls to run_cmd with &&, or using something like Chubler_XL suggested).
If you want to exit your script if any run_cmd fails in do_test, you could add the command:
in do_test before you invoke run_cmd the 1st time and add the command:
after you invoke run_cmd the last time in do_test.
Note that all of the commands you were passing to run_cmd are simple commands ("simple" as defined by the standards). If your real code passes pipelines, lists, or compound commands to run_cmd instead of just simple commands, examine the description of what set -e does for your shell in those cases in the standards or your shell's man page.
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Hi,
i got the following error when i tried to access the cygwin x server from a windows XP PC.
"xdmcp fatal error session failed session 23 failed for display"
Alternatively, when i tried to access the same Cygwin X Server from another windows XP PC which is on a different LAN... (3 Replies)
All,
I am working on planning a redundant SFTP setup and some jobs are ran using cron jobs. Would there be a way to some how failover a crontab to another server? (7 Replies)
I would like to know what means this error and how to fix it
Command 'rm -f -r "0yfOYy-0008Nq-2j-32233-K"'
failed with return code 1 and error message
Thank you (3 Replies)
Hi friends,....
am sindhiya,
i have joined as AIX level 1 support.
help me to identify the failed pv in vg which has some 4 physical volumes? (2 Replies)
Hi,
While I am trying SFTP my machine to another unix machine ,
it was working fine till 10 min back.
But now i am getting the below error
"Request for subsystem 'sftp' failed on channel 0"
Could you please someone help me to solve or analyise the root cause...
Cheers:b:,
Mahiban (0 Replies)
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Dear expert,
I have one server,in /var/adm/messages everyday present these messages:
Jan 3 06:01:30 SERVERGINTING genunix: WARNING: Device /pci@1d,700000/pci@1/scsi@2,1/sd@5,0 failed to power up.
Jan 3 06:01:31 SERVERGINTING scsi: WARNING: /pci@1d,700000/pci@1/scsi@2,1/sd@5,0 (sd45):... (2 Replies)
i edited the resolv.conf file, the i rebooted the machine, the following error appeard .. plz help
/rsc selftest failed return code 1
Error ==> timeout on character recieved , uart port D
FRU ==> plug-in card
caller ==> warning diag-process-error rsc-ini-eth-test ...
caller ==>... (1 Reply)