parpaa
asked on
File not found - Bash Script
Hi experts,
I'm facing issues in executing the bash script of mine. This script will pick the latest file received and connects SFTP server and files is placed on this remote server.
Error message
Sample code
Hope am clear with my requirements. Any help is greatly appreciated
Thank you
I'm facing issues in executing the bash script of mine. This script will pick the latest file received and connects SFTP server and files is placed on this remote server.
Error message
Enter password:
"File Movement"
sftp> cd Test
sftp> put Test_File_201309.txt
File "Test_File_201309.txt" not found.
Sample code
cd /somefolder/$folder_name
file1_To_Copy=`ls -tr *"$keyword1"*."$ftype" | tail -n 1`
if [[ condition1 == condition2 ]]
then
echo "File movement"
sftp host@abc.com <<EOF
cd Test
put ${file1_To_Copy}
EOF
fi
Hope am clear with my requirements. Any help is greatly appreciated
Thank you
Try removing that "cd Test" line.
ASKER
Hi gerwinjansen
I tried removing cd Test but no luck :(
I tried removing cd Test but no luck :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi gerwinjansen,
Apologies, the file was not present in the local working directory - Hence it was file was not found. Thank you so looking into this issue.
It has been resolved.
thank you
Apologies, the file was not present in the local working directory - Hence it was file was not found. Thank you so looking into this issue.
It has been resolved.
thank you
ASKER
thank you for your help
You're welcome ;)