I have a pair of public / private keys, so I can ssh to a remote server without having to log in. I am trying to write a shell script that lists all the folders in a specific directory on a remote server. My question is: how to specify a remote location? Here is what I have:
for file in myname@example.com:dir/*
do
if [ -d "$file" ]
then
echo $file;
fi
done
source
share