dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Mark Galeck <mark_galeck@pacbell.net>,
	"dash@vger.kernel.org" <dash@vger.kernel.org>
Subject: Re: why does dash save, dup, and restore redirected descriptor in the parent, rather than redirect in the child?
Date: Tue, 31 Jan 2017 21:30:54 +0100	[thread overview]
Message-ID: <d9dc79a9-9276-991e-5d91-8c4de1eaf1f9@gigawatt.nl> (raw)
In-Reply-To: <2132582962.805179.1485892834849@mail.yahoo.com>

On 31/01/2017 21:00, Mark Galeck wrote:
> Why save, dup and dup again to restore, descriptors in the parent, when it would be much simpler to just dup in the child, and not have to save and restore.

This assumes there's a child in the first place. Depending on the 
command, that might not be the case, think of built-in commands such as 
echo for instance. Code is needed to handle that case, and I suspect 
that if that code is there anyway, then having one place to set up 
redirections is simpler than having two places to set up redirections.

Cheers,
Harald van Dijk

  reply	other threads:[~2017-01-31 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2132582962.805179.1485892834849.ref@mail.yahoo.com>
2017-01-31 20:00 ` Mark Galeck
2017-01-31 20:30   ` Harald van Dijk [this message]
2017-02-01  2:27   ` Parke
2017-02-03 22:37     ` Jilles Tjoelker
2017-02-02 18:17   ` Mark Galeck

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=d9dc79a9-9276-991e-5d91-8c4de1eaf1f9@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=mark_galeck@pacbell.net \
    --subject='Re: why does dash save, dup, and restore redirected descriptor in the parent, rather than redirect in the child?' \
    /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

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).