I do file transfer using rsync from a server where the files/directories have space in their name. Using single quote, I escape the space and this works
rsync -svaz --progress 'root@192.168.1.2:/folder with space' '/downloads'
I am trying to write a bash script for the same but with no success, according to this thread, one can escape single quote by place it under a double quote. The following looks good
#!/bin/bash
read -e -p "source path: " SOURCEPATH
read -e -p "destination path: " DESPATH
echo "rsync -svaz --progress" "'""$SOURCEPATH""'" "'""$DESPATH""'"
But it doesn't work
#!/bin/bash
read -e -p "source path: " SOURCEPATH
read -e -p "destination path: " DESPATH
rsync -svaz --progress "'""$SOURCEPATH""'" "'""$DESPATH""'"