shell parsing bug with &>

Michael Conrad mconrad at intellitree.com
Fri Sep 7 16:41:38 UTC 2012


On 09/07/12 01:00, Rich Felker wrote:
> On Fri, Sep 07, 2012 at 06:50:48AM +0200, Harald Becker wrote:
>> Sorry if it sound provocative, I'm just interested/wondering what/why
>> are you doing here. Nothing more.
> I'm not doing it. I'm just uncomfortable with having a shell that will
> misinterpret conforming, albeit obfuscatd, shell scripts from third
> parties, and was giving one such example. I suspect the main place
> such code might come from a is a script that obfuscates and/or removes
> all unnecessary whitespace from a given shell script.
>
Would you happen to be the poor sucker tasked with writing that tool?  I
feel for you :-)

A tool like that would be up against all the deviations from the
standard that occur on countless shell versions throughout history that
exist across different flavors of UNIX.  Just look at the autoconf
project- they don't even use functions, for sake of compatibility.  Also
keep in mind that the standard was created long after the shells, in an
attempt to move them toward a common syntax.

Also, I think such a tool would have to handle Bash anyway, since it's
one of the most prevalent shells out there.  (also a number of distros
have bash masquerade as sh, which *should* make it conform to POSIX, if
you're lucky)

-Mike


More information about the busybox mailing list