passing variable (a path) with spaces
OK, I searched the forums and read that this should work, but it fails...
path="/media/My Passport" cd $path ls . returns "./dupes.sh: line 19: cd: /media/My: No such file or directory" but, if I escape the space it still fails: path="/media/My\ Passport" I have tried all variations I can think of without success... renaming the dir, mounting differently, or linking are not options, I need to deal with paths with spaces... Andrew |
You have to put quotes around the value when you use it:
Code:
cd "$path" |
Thank you. That works.
|
All times are GMT -5. The time now is 04:19 AM. |