All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Korb <bkorb@gnu.org>
To: Eric Blake <eblake@redhat.com>
Cc: David Korn <dgk@research.att.com>,
	austin-group-l@opengroup.org, Bash - Bug <bug-bash@gnu.org>,
	zsh-workers@zsh.org, dash <dash@vger.kernel.org>,
	miros-discuss@mirbsd.org
Subject: Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed  (-iEXTENSION)]
Date: Thu, 22 Dec 2011 14:09:30 -0800	[thread overview]
Message-ID: <4EF3AA9A.9070009@gnu.org> (raw)
In-Reply-To: <4EF39B1E.80709@redhat.com>

On 12/22/11 13:03, Eric Blake wrote:
> I assume on the ksh implementation that the temp file is discarded if
> the command (simple or compound) feeding the redirection failed?

One would hope!

>  If the
> redirection is used on a simple command, is there any shorthand for
> specifying that the destination name on success also be fed as an
> argument to the command, to avoid the redundancy of having to type
> 'file' both before and after the'>;' operator?

Doesn't the shell already have enough hieroglyphs?  It is what
intimidates many folks from figuring it out.

>  I assume that this is
> like any other redirection operator, where an optional fd number can be
> prepended, as in '2>; file' to collect stderr and overwrite file on
> success?

When the exact opposite is the useful variation?  I.e. keep-on-failure.
"-i" for sed is simple, understandable and implemented a lot.
Please don't add another glyph to the standardized shell.  Let us not
slide on slippery slopes.  Shells can always add some useful builtins:

    sh_move_if_changed
    sh_save_on_success
    sh_save_on_failure

to cope with this stuff.  Or you can write your own such library for
your own use.  ">;" is not an answer for sed-as-a-batch-editor anyway,
which is what "-i" really is.

  reply	other threads:[~2011-12-22 22:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201112221539.pBMFdlaj011933@penguin.research.att.com>
2011-12-22 21:03 ` '>; ' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)] Eric Blake
2011-12-22 22:09   ` Bruce Korb [this message]
     [not found]     ` <4EF3AA9A.9070009-mXXj517/zsQ@public.gmane.org>
2011-12-22 23:34       ` '>;' redirection operator Thorsten Glaser
2011-12-23  0:14     ` '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)] Geir Hauge
2011-12-22 22:06 David Korn

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=4EF3AA9A.9070009@gnu.org \
    --to=bkorb@gnu.org \
    --cc=austin-group-l@opengroup.org \
    --cc=bug-bash@gnu.org \
    --cc=dash@vger.kernel.org \
    --cc=dgk@research.att.com \
    --cc=eblake@redhat.com \
    --cc=miros-discuss@mirbsd.org \
    --cc=zsh-workers@zsh.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.