If/else or if file exists commands possible?

Advertisement

Dss
Guest

If/else or if file exists commands possible?

I am using winscp.com scripting and basically trying to first check if a file already exist. If it does, then I want to cancel the rest of the script. I can "fake" this by adding this to my script:

call if [ -d %MY_FILE_NAME% ]; then echo "Already using current version"; exit; fi    

as that breaks the "session" and causes all other commands to just crap out with
No Session.
No Session.
No Session.
No Session.

but is it possible to have a clean exit from the winscp script itself?

Thanks

Reply with quote

Advertisement

Blue_heights
Guest

Unknown command if

Hi guys,

I am executing script from windows using batch file and calling winscp internally, i want to perform conditional operation on linux server.
When I execute any if statement it gives me unknown command if.

Please help me, I just need to check if file exists on particular linux path, if not then move file from one linux path to above linux path.

Reply with quote

Advertisement

You can post new topics in this forum