Why is BASH lying?
by TBotNik from LinuxQuestions.org on (#5ETZD)
All,
In my BASH script I'm using:
Code:[ -d '/My & Path/MyDir/' ] && src-dir='/My & Path/MyDir/' || echo "Error: Directory not found!"BASH is always returning:
Code:No such file or directory
Error: Directory not found!However from the command line I issue:
Code:cd '/My & Path/MyDir/'
ls -alAnd it goes to the directory and displays all files there, so my Q is:
Why is BASH always lying?
Oh! Just to make sure BASH is not calling the file index I ran "updatedb", but still have the same results from my script!
Cheers!
TBNK


In my BASH script I'm using:
Code:[ -d '/My & Path/MyDir/' ] && src-dir='/My & Path/MyDir/' || echo "Error: Directory not found!"BASH is always returning:
Code:No such file or directory
Error: Directory not found!However from the command line I issue:
Code:cd '/My & Path/MyDir/'
ls -alAnd it goes to the directory and displays all files there, so my Q is:
Why is BASH always lying?
Oh! Just to make sure BASH is not calling the file index I ran "updatedb", but still have the same results from my script!
Cheers!
TBNK