
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] sh bug
- Date: Thu, 20 Feb 2003 10:40:28 +0900 (JST)
- From: "J. David Beutel" <jdb@example.com>
- Subject: Re: [tlug] sh bug
> $ cat >a
> a
> b
> x
> $ sh -c 'while read a; do if [ $a = "b" ]; then exit 1; fi; echo $a; done < a; echo done'
> a
> done
> $ ksh -c 'while read a; do if [ $a = "b" ]; then exit 1; fi; echo $a; done < a; echo done'
> a
What is the bug? The exit only ends the while loop? Or the parser is
susceptible to obfuscation?
I'm no shell wizard, but this looks obfuscated. Using "a" as the name of
the file, the contents of the first line of the file, the name of the
variable, and the echoed output is obfuscatory. So is using "done" as the
last echo string, since it is the same as the end of the while loop.
Finally, putting it all on one line doesn't make it any easier. So, I
wonder what the root problem is.
11011011
Home |
Main Index |
Thread Index