Hi all. I'm having difficulty working out how to get a script working when there are spaces in the folder path. I've tried all the suggestions that google has turned up, but none have worked. The code below tries to escape the space, but it doesn't work. I know that I can remove spaces, from the code and the folder itself, but I'd really like to learn how to write code that works without having to. Any help will be much appreciated.
#!/bin/zsh
source_folder="/Users/rg/Documents/Test\ 1/"
destination_folder="/Users/rg/Documents/Test\ 2/"
rsync -av --dry-run $source_folder $destination_folder
#!/bin/zsh
source_folder="/Users/rg/Documents/Test\ 1/"
destination_folder="/Users/rg/Documents/Test\ 2/"
rsync -av --dry-run $source_folder $destination_folder