NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/51718: sh still? accepts wrong do syntax



>Number:         51718
>Category:       bin
>Synopsis:       sh still? accepts wrong do syntax
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 15 03:30:00 +0000 2016
>Originator:     David A. Holland
>Release:        NetBSD 7.99.44 (20161208)
>Organization:
>Environment:
System: NetBSD macaran 7.99.44 NetBSD 7.99.44 (MACARAN) #40: Thu Dec 8 17:57:53 EST 2016 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

Start with this:

   macaran% sh -c 'do echo bar'
   sh: 1: Syntax error: "do" unexpected

   Exit 2
   macaran% 

Well and good (although the extra blank line should probably go away),
but now:

   macaran% sh -c 'echo foo; do echo bar'
   foo
   bar

You can also do the same thing with some additional keywords:

   macaran% sh -c 'echo foo; then echo bar'
   foo
   bar

   macaran% sh -c 'echo foo; else echo bar'
   foo
   bar

   macaran% sh -c 'echo foo; esac echo bar'
   foo
   bar

but not others:

   macaran% sh -c 'echo foo; in echo bar'
   foo
   in: not found
   Exit 127

>How-To-Repeat:

>Fix:

I vaguely recall I already filed a PR like this once, but if so I
thought it had been fixed.



Home | Main Index | Thread Index | Old Index