On Thu, Jul 14, 2011 at 07:15:33AM +1000, Nigel Allen wrote:
> I have started to write a bash script whoise first task is to find out
> if a file exists.
>
> A typical path for this file would be:
>
> /home/<username>/Maildir/.My<space>Plans.<space><space><space>125
>
> when I run the script I get a "no such file or directory" but when I run
> the ls command from the command line it works fine.
The script has to quote the variable when it is used inside the script,
e.g.
if [ -f "$1" ] then
echo "File $1 exists"
fi
Nick.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html