I want to create a directory if it doesn't exists after login to sftp server.
sftp email@example.com << EOF mkdir test put test.xml bye EOF
Now i call test.sh and upload different files each time to test folder. When running this
First time it works and second time it throws Couldn't create directory: Failure error?
How to create a directory if doesn't exists and if exists don't create directory in sftp.