home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!odin!chet
- From: chet@odin.INS.CWRU.Edu (Chet Ramey)
- Subject: Re: [ vs. [[ in ksh
- Message-ID: <1992Jul21.114928.12787@usenet.ins.cwru.edu>
- Sender: news@usenet.ins.cwru.edu
- Nntp-Posting-Host: odin.ins.cwru.edu
- Organization: Case Western Reserve University, Cleveland, OH (USA)
- References: <1992Jul16.055054.20973@ddsw1.mcs.com> <1992Jul16.180423.7628@u.washington.edu> <Brp7Lr.AI5@root.co.uk>
- Date: Tue, 21 Jul 92 11:49:28 GMT
- Lines: 21
-
- In article <Brp7Lr.AI5@root.co.uk> gwc@root.co.uk (Geoff Clare) writes:
-
- >The work-around for this one is [ X"$X" = X"$Y" ], which is pretty robust.
- >However, there are some things that are even harder to protect against,
- >and you begin to wonder whether it's worth it. Consider [ -f "$FILE" ],
- >a very common usage, and what happens when FILE contains `='.
-
- The Posix.2 specification of test contains a much more robust algorithm
- based on the number of arguments to the test command that avoids many
- of the traditional problems.
-
- Bash implements this algorithm; so does the standalone GNU shellutils
- `test'.
-
- Chet
- --
- ``The use of history as therapy means the corruption of history as history.''
- -- Arthur Schlesinger
-
- Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu
-