Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

empty lists in for

1 view
Skip to first unread message

Sheldon Hearn

unread,
Mar 4, 2000, 3:00:00 AM3/4/00
to Max Khon

On Mon, 21 Feb 2000 22:10:15 +0600, Max Khon wrote:

> bash and ksh complain about unexpected ';'.
> /bin/sh (FreeBSD) thinks it's ok and does nothing.
> Which behaviour is more POSIXly correct?

Neither bash nor ksh claim to be particularly POSIX compliant. our
/bin/sh does. I seem to remember POSIX being ambiguous on this one, but
my books are at the office. If you haven't gotten a more conclusive
answer by Monday, mail me and I'll look it up.

Later,
Sheldon.


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message

Doug Barton

unread,
Mar 5, 2000, 3:00:00 AM3/5/00
to W Gerald Hicks
W Gerald Hicks wrote:
>
> > > bash and ksh complain about unexpected ';'.
> > > /bin/sh (FreeBSD) thinks it's ok and does nothing.
> > > Which behaviour is more POSIXly correct?
>
> >
> > Neither bash nor ksh claim to be particularly POSIX compliant. our
> > /bin/sh does. I seem to remember POSIX being ambiguous on this one, but
> > my books are at the office. If you haven't gotten a more conclusive
> > answer by Monday, mail me and I'll look it up.
>
> I much prefer the current behavior and believe there may be many things
> which depend on it.

Given that Bash in both standard and POSIX mode complains about 'for i
in ; do echo $i; done', I would say that it's not POSIX compatible. What
could/does depend on this behavior "working?"

Doug
--
"Welcome to the desert of the real."

- Laurence Fishburne as Morpheus, "The Matrix"

W Gerald Hicks

unread,
Mar 5, 2000, 3:00:00 AM3/5/00
to hac...@freebsd.org

> > bash and ksh complain about unexpected ';'.
> > /bin/sh (FreeBSD) thinks it's ok and does nothing.
> > Which behaviour is more POSIXly correct?

>
> Neither bash nor ksh claim to be particularly POSIX compliant. our
> /bin/sh does. I seem to remember POSIX being ambiguous on this one, but
> my books are at the office. If you haven't gotten a more conclusive
> answer by Monday, mail me and I'll look it up.

I much prefer the current behavior and believe there may be many things
which depend on it.

Cheers,

Jerry Hicks
jh...@mindspring.com

Doug Barton

unread,
Mar 5, 2000, 3:00:00 AM3/5/00
to Sheldon Hearn
Sheldon Hearn wrote:
>
> On Mon, 21 Feb 2000 22:10:15 +0600, Max Khon wrote:
>
> > bash and ksh complain about unexpected ';'.
> > /bin/sh (FreeBSD) thinks it's ok and does nothing.
> > Which behaviour is more POSIXly correct?
>
> Neither bash nor ksh claim to be particularly POSIX compliant.

I can't speak knowledgeably about ksh, but bash has POSIX compliance as
one of it's main goals. Check out
http://freebsd.simplenet.com/Bash-FAQ.txt and search for the word POSIX.
It even has a "posix mode" that makes it more strict than it already is.

> our /bin/sh does.

We do a pretty good job here of course. People like Martin Cracauer
(and a host of others) have worked very hard to keep our /bin/sh in line
with the standards.

> I seem to remember POSIX being ambiguous on this one, but
> my books are at the office. If you haven't gotten a more conclusive
> answer by Monday, mail me and I'll look it up.

Unfortunately I missed the original. What was the questioner trying to
do?

Doug
--
"Welcome to the desert of the real."

- Laurence Fishburne as Morpheus, "The Matrix"

0 new messages