<<< Date Index >>>     <<< Thread Index >>>

Re: when using `which` send errors to /dev/null



On 23May2007 21:21, David Champion <dgc@xxxxxxxxxxxx> wrote:
| * On 2007.05.23, in <20070523233131.GA22736@xxxxxxxxxxxxxxx>,
| *     "Cameron Simpson" <cs@xxxxxxxxxx> wrote: 
| >   printf "%s\n" "$PATH" | tr : '\012' | while read -r dir; do
| > Unless that breaks on Solaris, which it may:-(
| 
| I don't think -r is present in a strict Bourne shell's "read".
| Solaris's gives "-r: is not an identifier", but I don't expect that it's
| limited to Solaris.

I think it's POSIX standard, but not SysV Bourne shell (sorry, no chapter
and verse to hand). Solaris ships with the latter as /bin/sh.

But as you point out, a single exception may be enough.
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

"I think I've just made the biggest mistake of my life."                - Villa
"That seems unlikely. I would predict that there are far greater mistakes
 waiting to be made by someone of your obvious talent for them."        - Orac