script should stop if cd fails
I am writing a script to put files. For example,
option confirm on
open user@domain
cd /wherever
put index.html
But if the "cd" command fails, because the "/wherever" directory does not exist, then the script continues on. It then writes over the file index.html in the default directory.
My workaround is to turn on file overwrite confirmation, but I will have to look carefully that there is no error message a few lines up.
I would like a confirmation or abort after "cd" fails.
Thanks! 8)
option confirm on
open user@domain
cd /wherever
put index.html
But if the "cd" command fails, because the "/wherever" directory does not exist, then the script continues on. It then writes over the file index.html in the default directory.
My workaround is to turn on file overwrite confirmation, but I will have to look carefully that there is no error message a few lines up.
I would like a confirmation or abort after "cd" fails.
Thanks! 8)