Re: Problem outputting a quote in a variable expansion which is in a here doc

2016-12-07 Thread Chet Ramey
On 12/6/16 7:56 PM, Daniel Einspanjer wrote: > Bash Version: 4.4 > Patch Level: 5 > Release Status: release > > Description: > Tested on OSX as well as Ubuntu GNU/Linux 14.4 and Debian Jessie 8 > Tested with Bash 4.3 and 4.4 > > When trying to output a string from a variable expansio

Re: Problem outputting a quote in a variable expansion which is in a here doc

2016-12-07 Thread Daniel Einspanjer
Awesome, thanks for this tip! On Wed, Dec 7, 2016 at 8:44 AM Greg Wooledge wrote: > On Wed, Dec 07, 2016 at 12:56:00AM +, Daniel Einspanjer wrote: > > echo The desired output is: > > echo "var = \"test test\"" > > imadev:~$ q=\" > imadev:~$ var="a variable" > imadev:~$ cat < > ${var:+var = $

Re: Problem outputting a quote in a variable expansion which is in a here doc

2016-12-07 Thread Greg Wooledge
On Wed, Dec 07, 2016 at 12:56:00AM +, Daniel Einspanjer wrote: > echo The desired output is: > echo "var = \"test test\"" imadev:~$ q=\" imadev:~$ var="a variable" imadev:~$ cat < ${var:+var = $q$var$q} > EOF var = "a variable" imadev:~$ echo "$BASH_VERSION" 4.4.0(1)-release Putting literal q

Problem outputting a quote in a variable expansion which is in a here doc

2016-12-07 Thread Daniel Einspanjer
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: darwin15.6.0 Compiler: clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='darwin15.6.0' -DCONF_MACHTYPE='x86_64-apple-darwin15.6.0' -DCONF_VENDOR='apple' -DLOCALEDIR='/usr/local/