I am trying to verify if a directory exists prior to moving a file in Korn, using the classic:
if [[ -d ${dir} ]]; then
scp file
else
exit 12
fi
My Problem:
That the directory is on another server, so whenever I check, the script can't find it and therefore fails and exits every time.
My Question:
Is there a way to do a "-d" across the network, perhaps using sftp/scp-like functionality? The user currently does not have to enter a password and can scp fine, so that is one less issue.