Re: "$@" vs. nounset

2009-07-03 Thread Andreas Schwab
Yang Zhang writes: > As a result I'm forced to use "${@:-}" or something like that The correct idiom is ${1+"$@"}, which also works around the old Bourne shell bug that causes "$@" to expand to a single empty argument when there are no positional arguments. Andreas. -- Andreas Schwab, sch...@

Re: [Fwd: Bug#519165: bash 4 regression]

2009-07-03 Thread Chet Ramey
Matthias Klose wrote: > wouldn't this changed behaviour warrent a compatibility switch? I'm going to do what the Posix group decides. Read http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00107.html for a summary; portions of which I will reproduce below. (And the line that got munged in

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Chet Ramey
Richard Neill wrote: > This is still a missing feature: how to embed newlines in double-quoted > bash string assignment: > > For example, if I want to write: > > EMAIL_BODY="Dear $NAME,$'\n\n'Here are the log-files for > $(date)$'\n\n'Regards,$'\n\n'$SENDER" > > then this doesn't work. There ar

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Chet Ramey
Chris F.A. Johnson wrote: > On Fri, 3 Jul 2009, fsc-log-...@richardneill.org wrote: >> Fix: >> $'\n' should be expanded within double-quotes, like other variables >> are. >> Otherwise, please correct the man-page to make it clearer. > >$'\n' is not a variable. As the man page say

[Fwd: Bug#519165: bash 4 regression]

2009-07-03 Thread Matthias Klose
wouldn't this changed behaviour warrent a compatibility switch? --- Begin Message --- # justification: breaks plenty other packages, # and if only by way of #522255 severity 518752 grave tags 518752 upstream confirmed thanks also sprach Andreas Metzler [2009.03.08.1442 +0100]: > d. Fixed a bug

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Dave B
On Friday 03 July 2009, Richard Neill wrote: > > X=$'a\nb c' > > This is still a missing feature: how to embed newlines in double-quoted > bash string assignment: > > For example, if I want to write: > > EMAIL_BODY="Dear $NAME,$'\n\n'Here are the log-files for > $(date)$'\n\n'Regards,$'\n\n'$SENDE

Re: $\n doesn't get expanded between double-quotes ['PureMessage.Watchdog': checked]

2009-07-03 Thread Chet Ramey
fsc-log-...@richardneill.org wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' > -DCONF_VENDOR=

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Chris F.A. Johnson
On Fri, 3 Jul 2009, Richard Neill wrote: > > > Description: > > > Bash allows escape characters to be embedded by using the $'\n' > > > syntax. However, unlike all other $variables, > > > this doesn't work with embedded newlines. I think it should. > > > > > > Repeat-By: > > > X="a$'\

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Andreas Schwab
Richard Neill writes: > This is still a missing feature: how to embed newlines in > double-quoted bash string assignment: Literal newlines work just fine. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for so

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Richard Neill
Thanks for your reply. Description: Bash allows escape characters to be embedded by using the $'\n' syntax. However, unlike all other $variables, this doesn't work with embedded newlines. I think it should. Repeat-By: X="a$'\n'b c" echo "$X" expect to