On Fri, Jul 03, 2009 at 01:01:47PM -0400, Chris F.A. Johnson wrote:
> NL=$'\n'
> string="This is a$NLmulti-line$NLstring"
Of course you would need curly braces for that.
NL=$'\n'
string="This is a${NL}multi-line${NL}string"
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
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
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
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=
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$'\
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
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
On Fri, 3 Jul 2009, 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-g
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='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
10 matches
Mail list logo