I am trying to create a script that will test for the existence of a file, then create it if it doesn't exist. The problem is that when I specify the absolute path /usr/local/custom/path/filename it recognizes "local" as a keyword? What is weird is that I specify the path twice but it only highlights it the second time. I know that escaping it with \ will work but was wondering if there was a better way? Thanks!
-
Unsolved BASH Scripting.
-
You should be good to go by just putting double-quotes (" ") around your path like so...
if [ -e "/usr/local/custom/path/filename" ] ; then...
I hope that gets the job done for you.
DanielITProTV
Show Host -
Thanks Daniel. Worked great. By the way...really enjoy watching your shows on BASH scripting.
Sincerely,
Ryan