Idea is to check remote folder. Is it exist or no? I try this
ssh -p 22 -tt user@server.com 'bash -d /home/test22
and it works fine
/home/test22: /home/test22: is a directory Connection to server.com closed.
But when I try to use it with "IF" - it is wrong...always said "That directory exists"
#!/bin/bash
if [ "ssh -p 22 -tt user@server.com 'bash -d /home/test22'" ]; then
echo "That directory exists"
else
echo "That directory doesn't exists"
fi
Can you show correct example?
Thank you!