Subject: bin/12486: /bin/ksh (pdksh 5.2.14) parameter expansion/quoting bug
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mkb@mukappabeta.de>
List: netbsd-bugs
Date: 03/28/2001 00:17:07
>Number:         12486
>Category:       bin
>Synopsis:       /bin/ksh (pdksh 5.2.14) parameter expansion/quoting bug
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 27 14:32:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Buelow
>Release:        1.5/i386
>Organization:
>Environment:
System: NetBSD altair.mayn.de 1.5 NetBSD 1.5 (ALTAIR) #0: Mon Dec 4 18:48:50 CET 2000 root@altair.mayn.de:/usr/src/sys/arch/i386/compile/ALTAIR i386

>Description:

The NetBSD version of /bin/ksh, which identifies itself as "PD KSH
v5.2.14 99/07/13.2", exhibits a bug with parameter expansion inside
double quotes.  Normally, "${xyz:-'}" should expand to a literal
"'" (single quote) when the variable xyz is unset, whereas pdksh
gets confused and ignores the fact that the expansion is enclosed
inside double quotes and continues to read input, waiting for a
closing single quote:

pdksh$ echo "${a:-'}"
> 
> ^C
pdksh$ 

vs.

sh$ echo "${a:-'}"
'
sh$ 

The second example shows the correct behaviour, as exhibited by
NetBSD's /bin/sh aswell as ksh88/ksh93 and the System V Bourne sh.

A Cc: of this problem report goes to Michael Rendell, the maintainer
of pdksh.

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: