Topic "Checking whether call command executed properly or not"

Author Message
Rick

Guest


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
Code:
.
.
.
.
.
.
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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
You can use "option batch abort" to break the script on any error.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License