From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5371 invoked by alias); 23 Dec 2011 00:40:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30045 Received: (qmail 27468 invoked from network); 23 Dec 2011 00:40:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.50 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/9hQRsNNUx07s3wzEghSf7PdyP3Z+ajr8UTrGW/57UQ=; b=k5IJHCVySsCXNc4k4rDd/w97Gsllm9SOf3gW2zkE3GRzMKjr9hwtOm2Tx4ex6F/cRO 6rDnixzrCPz2tgmVW0JfB3hkzqEEvGUThsXDl9IgpO/LshAfN2WpK4cgNcWSgYMDQmrG /OfgIcdeXNi8oqM004/zr8HS5QSA4zOycBH9Q= MIME-Version: 1.0 In-Reply-To: <4EF3AA9A.9070009@gnu.org> References: <201112221539.pBMFdlaj011933@penguin.research.att.com> <4EF39B1E.80709@redhat.com> <4EF3AA9A.9070009@gnu.org> Date: Fri, 23 Dec 2011 01:14:03 +0100 Message-ID: Subject: Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)] From: Geir Hauge To: Bruce Korb Cc: Eric Blake , David Korn , dash , austin-group-l@opengroup.org, zsh-workers@zsh.org, Bash - Bug , miros-discuss@mirbsd.org Content-Type: multipart/alternative; boundary=20cf303b40035bcbb804b4b74bca --20cf303b40035bcbb804b4b74bca Content-Type: text/plain; charset=ISO-8859-1 2011/12/22 Bruce Korb > > 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 --20cf303b40035bcbb804b4b74bca--