NetBSD-Bugs archive

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

bin/48489: sh(1) allows trailing && and ||

>Number:         48489
>Category:       bin
>Synopsis:       sh(1) allows trailing && and ||
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 02 04:25:00 +0000 2014
>Originator:     David A. Holland
>Release:        NetBSD 6.99.28 (20131210)
System: NetBSD valkyrie 6.99.28 NetBSD 6.99.28 (VALKYRIE) #14: Tue Dec 10 
15:15:49 EST 2013  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE 
Architecture: x86_64
Machine: amd64

sh accepts trailing && or ||, which ought to be a syntax error.


sh -c 'true &&'
sh -c 'true ||'

Both ksh and bash report a syntax error. For that matter, so do csh
and tcsh.

zsh does not, but zsh can't really be taken as an authoritative


dunno, the sh parser is an eldritch horror

Home | Main Index | Thread Index | Old Index