dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Bulatov <oleg@bulatov.me>
To: Joerg Schilling <joerg.schilling@fokus.fraunhofer.de>,
	"eblake@redhat.com" <eblake@redhat.com>,
	"dash@vger.kernel.org" <dash@vger.kernel.org>,
	"austin-group-l@opengroup.org" <austin-group-l@opengroup.org>
Subject: Re: heredoc and subshell
Date: Wed, 24 Feb 2016 23:27:39 +0300	[thread overview]
Message-ID: <1528771456345659@web29m.yandex.ru> (raw)
In-Reply-To: <56cd8cd1.LdVYbpfe+0tQMm8I%Joerg.Schilling@fokus.fraunhofer.de>

24.02.2016, 13:58, "Joerg Schilling" <Joerg.Schilling@fokus.fraunhofer.de>:
> BTW: If I replace $(..) by `..` and feed the code to the original SVr4 Bourne
> Shell, I get the same output as you got from bash. I would guess that the bash
> output you added above is correct.

The behavior of `..` with heredoc has also interesting corner cases:

$ cat x.sh 
cat <<END ; echo `echo a
echo b`
hello
END
$ dash x.sh 
echo ba
x.sh: 3: x.sh: hello: not found
x.sh: 4: x.sh: END: not found
$ bash x.sh
hello
a b
$

On the one hand it reads heredoc, on the other hand it processes closing of the subshell.

-- 
Oleg

  parent reply	other threads:[~2016-02-24 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 22:07 heredoc and subshell Oleg Bulatov
2016-02-23 22:49 ` Eric Blake
2016-02-23 23:16   ` Eric Blake
     [not found]   ` <56CCE1E3.1060805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-24 10:58     ` Joerg Schilling
     [not found]       ` <56cd8cd1.LdVYbpfe+0tQMm8I%Joerg.Schilling-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh@public.gmane.org>
2016-02-24 12:27         ` Shware Systems
2016-02-24 12:32           ` Joerg Schilling
2016-02-24 20:27       ` Oleg Bulatov [this message]
2016-02-23 23:18 ` Jilles Tjoelker
2016-02-24  8:46   ` Thorsten Glaser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528771456345659@web29m.yandex.ru \
    --to=oleg@bulatov.me \
    --cc=austin-group-l@opengroup.org \
    --cc=dash@vger.kernel.org \
    --cc=eblake@redhat.com \
    --cc=joerg.schilling@fokus.fraunhofer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).