[gnu.bash.bug] bugs in command line.

skl@ABEL.MATH.UIUC.EDU (Soren Lundsgaard) (09/27/89)

There is one bug report which I submitted which is still
outstanding:  ${1+"$@"} is not expanded correctly if there is a
word with a space in it.

also, the following command works in other shells but not in bash

sed 's/   */\
/g' oldfile

The \-newline pair dissapears.  (In csh, using \\-newline works.)

my apologies to the list readers if these have already been fixed.

Thank you again to bfox, for the neat shell.

skl.

chet@cwns1.CWRU.EDU (Chet Ramey) (09/27/89)

In article <8909271448.AA28013@abel.math.uiuc.edu> skl@ABEL.MATH.UIUC.EDU (Soren Lundsgaard) writes:
>There is one bug report which I submitted which is still
>outstanding:  ${1+"$@"} is not expanded correctly if there is a
>word with a space in it.

Quoting from the SunOS 4.0 sh man page, which is derived from that of Sys 5
release 3.1:

"Blank Interpretation

After parameter and command substitution, the results of substitution are
scanned for internal field separator characters (those found in IFS) and
split into distinct arguments where such characters are found.  Explicit
null arguments ("" or '') are retained.  Implicit null arguments (those
resulting from parameters that have no values) are removed."

This sounds pretty much like what bash is doing.  If you want to preserve
quotes, quote the whole thing ("${1+$@}").

I don't have a copy of the POSIX 1003.2 spec (the defining document for
bash), but I assume it was derived from the System V Release 3 sh man page
(or at least that man page was used as a reference for this behavior).

Chet Ramey
-- 
Chet Ramey			"We are preparing to think about contemplating 
Network Services Group, CWRU	 preliminary work on plans to develop a
chet@cwjcc.INS.CWRU.Edu		 schedule for producing the 10th Edition of 
				 the Unix Programmers Manual." -- Andrew Hume