[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Re: for p; do ... solaris syntax error
From: |
Alexandre Duret-Lutz |
Subject: |
[Bug-gnulib] Re: for p; do ... solaris syntax error |
Date: |
Thu, 14 Nov 2002 21:23:00 +0100 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) |
Hi Karl,
>>> "Karl" == Karl Berry <address@hidden> writes:
Karl> I just found that
Karl> for p; do ...
Karl> gets a syntax error with Solaris 2.7 /bin/sh:
Karl> /tmp/x.sh: syntax error at line 1: `;' unexpected
Karl> I am surprised (make that flabbergasted) at this. Both that such an
Karl> obvious bug is there, and that it hasn't been noticed before this (or
Karl> maybe it has? It's hard to search for since all the words involved are
Karl> English prepositions ...). In fact, I'm wondering if I'm just going
Karl> crazy. I did try a couple of different machines.
I can reproduce it too. However it seems that replacing the
semicolon by a newline will do the trick.
for p
do
...
done
[...]
Karl> At any rate, assuming the bug is really there, is there a
Karl> problem with using for p in "$@"; do ... instead? (This
Karl> will affect mkinstalldirs and texi2dvi for starters.) Or
Karl> for p in "${1+"$@"}; do ... would be better for the sake
Karl> of Digital Unix/Ultrix perhaps?
FWIW the Autoconf manual has a section explaining that ${1+"$@"}
isn't the panacea.
Karl> I want to make my Texinfo release today, so I'm planning
Karl> to just change texinfo's local mkinstalldirs and do it,
Karl> barring advice that this would be a horrible mistake.
For mkinstalldirs you could uses Automake's copy. It's already
using this do-on-next-line form.
--
Alexandre Duret-Lutz