|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Unix * weirdness
Subject: Re: Unix * weirdness
From: Blue Boar (BlueBoar
THIEVCO.COM)
Date: Sat Jan 01 2000 - 21:29:20 CST
- Next message: Blue Boar: "Re: Unix * weirdness"
- Previous message: Antonomasia: "Re: Unix * weirdness"
- In reply to: Andrew W. Flury: "Re: Unix * weirdness"
- Next in thread: nascheme
ENME.UCALGARY.CA: "Re: Unix * weirdness"
- Reply: Blue Boar: "Re: Unix * weirdness"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Andrew W. Flury" wrote:
> > /usr/bin/rm -rf /tmp/*
>
> The above command would work properly with a file named "-foo" in /tmp. The
> shell would simply replace /tmp/* with /tmp/-foo (among other things), which
> isn't parsed by getopt(3). There is only a problem here if the script did
> something like "cd /tmp && rm -rf *".
How about if it's -foo with a space in front? The /tmp example is
a bad one... the point is to delete all files and subdirectories
anyway, so perhaps that's why Sun ships with the above statement.
I have to wonder if I could get the rm to choke, and therefore the script
to abort. That would allow files to stick around between reboots in /tmp.
A pretty minor problem.
> All of these characters are interpreted BEFORE the glob (*) is expanded, so
> they should work just fine. The only exception would be if the programmer
> does something dumb like passing the glob to eval.
That was one of the key questions I was trying to ask.
BB
- Next message: Blue Boar: "Re: Unix * weirdness"
- Previous message: Antonomasia: "Re: Unix * weirdness"
- In reply to: Andrew W. Flury: "Re: Unix * weirdness"
- Next in thread: nascheme
ENME.UCALGARY.CA: "Re: Unix * weirdness"
- Reply: Blue Boar: "Re: Unix * weirdness"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This archive was generated by hypermail 2b27 : Sat Jan 01 2000 - 21:43:58 CST