Topic "Checking whether call command executed properly or not"

Author Message


I am having s script file given as an input to 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
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
call sh
mkdir /home/user/temp

So in this code i want to stop execution whenever exits with non-zero return code.
How can I achieve this?
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
You can use "option batch abort" to break the script on any error.
Martin Prikryl

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License