From: Geir Hauge <geir.hauge@gmail.com>
To: Bruce Korb <bkorb@gnu.org>
Cc: Eric Blake <eblake@redhat.com>, David Korn <dgk@research.att.com>,
dash <dash@vger.kernel.org>,
austin-group-l@opengroup.org, zsh-workers@zsh.org,
Bash - Bug <bug-bash@gnu.org>,
miros-discuss@mirbsd.org
Subject: Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]
Date: Fri, 23 Dec 2011 01:14:03 +0100 [thread overview]
Message-ID: <CAO-BiTJXqLgMJSxoow8HTurLEGDk84x0=jv=UJJJZwByY_nTmA@mail.gmail.com> (raw)
In-Reply-To: <4EF3AA9A.9070009@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
2011/12/22 Bruce Korb <bkorb@gnu.org>
>
> When the exact opposite is the useful variation? I.e. keep-on-failure.
> "-i" for sed is simple, understandable and implemented a lot.
>
As far as I know, -i is only implemented with GNU sed and BSD sed, and they
are incompatible, BSD sed's -i takes a mandatory argument, while GNU sed's
-i takes an optional string which must be provided in the same argument.
E.g.
gnused -i.bak sed-script file
bsdsed -i .bak sed-script file
So the only portable way of using sed to "edit" (read: overwrite) a file is
with
sed sed-script file > file.tmp && mv file.tmp file
I'd welcome this >; syntax.
--
Geir Hauge
prev parent reply other threads:[~2011-12-23 0:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201112221539.pBMFdlaj011933@penguin.research.att.com>
2011-12-22 21:03 ` Eric Blake
2011-12-22 22:09 ` Bruce Korb
2011-12-22 23:34 ` '>;' redirection operator Thorsten Glaser
2011-12-23 0:14 ` Geir Hauge [this message]
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='CAO-BiTJXqLgMJSxoow8HTurLEGDk84x0=jv=UJJJZwByY_nTmA@mail.gmail.com' \
--to=geir.hauge@gmail.com \
--cc=austin-group-l@opengroup.org \
--cc=bkorb@gnu.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).