[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Supp
From: |
Geir Hauge |
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 |
2011/12/22 Bruce Korb <address@hidden>
>
> 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
- '>; ' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)], Eric Blake, 2011/12/22
- Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)], Bruce Korb, 2011/12/22
- Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)],
Geir Hauge <=
- Re: '>;' redirection operator, Thorsten Glaser, 2011/12/24
- Re: '>;' redirection operator, Bill Gradwohl, 2011/12/24
- Re: '>;' redirection operator, Pierre Gaston, 2011/12/24
- Re: '>;' redirection operator, Chris Jones, 2011/12/24
- Re: '>;' redirection operator, Bill Gradwohl, 2011/12/24
- Re: '>;' redirection operator, Gerard Seibert, 2011/12/24
- Re: '>;' redirection operator, Roman Rakus, 2011/12/25