I am running an SFTP batch to get a series of files from one unix server to another. I have a shell script that builds the batch files like:

cd path

get filename

cd path

get filename

and more.

Is there a way within SFTP to NOT run a get command if the preceding cd command fails, but keep running the rest of the batch?

To be clear, I do NOT want to terminate the whole SFTP batch, just the one get command if it's related cd command does not work.

没有正确的解决方案

其他提示

After each cd check error code, if it is 0, everything is fine. If not, some error occured in last command...

Like:

cd directory
if [!$?]
then
   get something
fi
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top