Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Checking whether call command executed properly or not

You can use "option batch abort" to break the script on any error.
Rick

Checking whether call command executed properly or not

I am having s script file given as an input to WinSCP.com tool. Script file consists of few commands out of which one important command is "call". This command calls shell script which will then be executed on remote linux machine.
In case of any error in shell script, it returns non-zero value and then control is returned to the script file provided as input to WinSCP.com.
But this script continues to execute further commands as previous call command (which has now executed shell script) was successful. But it does not check whether the execution of shell script was successful or not.
I want a behaviour where that script will return with exit code non-zero whenever shell script returns with error.

I am posting here some part of my script provided to WinSCP.com
.

.
.
.
.
.
call sh script.sh
mkdir /home/user/temp
.
.
.
close
exit


So in this code i want WinSCP.com to stop execution whenever script.sh exits with non-zero return code.
How can I achieve this?