zsh-workers
 help / color / mirror / code / Atom feed
* sh compatibility issue
@ 2011-02-18  3:55 Vincent Stemen
  2011-02-18 10:30 ` Peter Stephenson
  0 siblings, 1 reply; 15+ messages in thread
From: Vincent Stemen @ 2011-02-18  3:55 UTC (permalink / raw)
  To: zsh-workers

Hi.

I have encountered a minor compatibility issue when using zsh in place
of /bin/sh on FreeBSD.

When attempting to compile the base system, it gets the error

    /usr/src/gnu/usr.bin/binutils/ld/genscripts.sh:43: parse error near `)'
    *** Error code 1

The error comes from this piece of code in genscripts.sh

    # XXX: arm hack : until those file are merged back into the FSF repo,
    # just
    # use the version in this directory.
    if !(test -f ${CUSTOMIZER_SCRIPT}"";) then
    CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${EMULATION_NAME}.sh"
    fi

What is happening is that zsh does not like the '!' being next to the
opening '(' without a space in the if condition.  In my opinion, this is
kind of an unorthodox syntax.  I'm not even sure if it is traditionally
legal sh or ksh syntax.  Nevertheless, it works with BSD sh and bash.
A simple test is

    if !(echo hello); then echo "XXXX"; fi
    if ! (echo hello); then echo "XXXX"; fi

Zsh works fine in the second case, with a space after the '!'.

I also tested without the space under ksh on NetBSD and got a strange
result.  It ran the mail utility.  Weird.

My question is, is it possible and reasonable to modify zsh to work
without the space so that screwy GNU software such as this will compile?

Regards,
Vince



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-03-06 20:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18  3:55 sh compatibility issue Vincent Stemen
2011-02-18 10:30 ` Peter Stephenson
2011-02-18 22:45   ` Vincent Stemen
2011-02-19 23:05   ` Jilles Tjoelker
2011-02-20  0:41     ` Vincent Stemen
2011-02-20 19:11     ` Peter Stephenson
2011-02-20 20:17       ` Peter Stephenson
2011-02-20 21:12         ` Vincent Stemen
     [not found]       ` <4D618A11.3050406@case.edu>
2011-02-22 20:02         ` Peter Stephenson
2011-02-23  1:08           ` Vincent Stemen
2011-02-23  1:51             ` Bart Schaefer
2011-02-23  2:30               ` Vincent Stemen
2011-02-23  9:25               ` Peter Stephenson
2011-03-04 13:36           ` Jilles Tjoelker
2011-03-06 20:26             ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).