I have a space in one of the directory names. I want to list a file under it from a bash script. Here is my script:
fpath="${HOME}/\"New Folder\"/foobar.txt"
echo "fpath=(${fpath})"
#fpath="${HOME}/${fname}"
ls "${fpath}"
The output for this script is:
fpath=(/Users/<username>/"New Folder"/foobar.txt)
ls: /Users/<username>/"New Folder"/foobar.txt: No such file or directory
But when is list the file on my shell it exists:
$ ls /Users/<username>/"New Folder"/foobar.txt
/Users/<username>/New Folder/foobar.txt
Is there a way I can get ls
to display the path from my script?