Wanted to create a directory in my remote server by executing the script from my local, expected directory is not getting created on the remote VM and no error message is given as well.
I tried to escape the variable using \
, enclosed the variable in single as well as in double quotes, but of no luck..
What am I missing ?
#!/bin/bash
password="mypassword"
remote_ip="10.28.28.28"
dir_to_create="/home/rocket/DjangoDir"
sshpass -p ${password} ssh -q -tt user@${remote_ip} << 'EOT'
mkdir -p \$dir_to_create
exit
EOT
Also, tried "\$dir_to_create"
, \"$dir_to_create"
and \"${dir_to_create}"