문제

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