From owner-freebsd-questions@FreeBSD.ORG Tue Jun 21 15:24:39 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E66E106564A for ; Tue, 21 Jun 2011 15:24:39 +0000 (UTC) (envelope-from lars@oddbit.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DE5F68FC20 for ; Tue, 21 Jun 2011 15:24:38 +0000 (UTC) Received: by iyb11 with SMTP id 11so2596669iyb.13 for ; Tue, 21 Jun 2011 08:24:38 -0700 (PDT) Received: by 10.42.170.3 with SMTP id d3mr7561350icz.438.1308669878313; Tue, 21 Jun 2011 08:24:38 -0700 (PDT) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx.google.com with ESMTPS id ft12sm3857662ibb.2.2011.06.21.08.24.36 (version=SSLv3 cipher=OTHER); Tue, 21 Jun 2011 08:24:37 -0700 (PDT) Received: by iyb11 with SMTP id 11so2596636iyb.13 for ; Tue, 21 Jun 2011 08:24:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.10.138 with SMTP id p10mr6601758ibp.84.1308669876546; Tue, 21 Jun 2011 08:24:36 -0700 (PDT) Received: by 10.231.39.137 with HTTP; Tue, 21 Jun 2011 08:24:36 -0700 (PDT) In-Reply-To: <73E783DC-E32B-4DE3-AFF6-4A75D1D3A00A@conundrum.com> References: <73E783DC-E32B-4DE3-AFF6-4A75D1D3A00A@conundrum.com> Date: Tue, 21 Jun 2011 11:24:36 -0400 Message-ID: From: Lars Kellogg-Stedman To: Matthew Pounsett Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: sed argument processing b0rked? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 15:24:39 -0000 >> sed -i'' -e 's/^\(REVOKE ALL ON SCHEMA public FROM \)postgres/\1pgsql/' = \ > ? =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-e 's/^\(GRANT ALL ON SCHEMA public T= O \)postgres/\1pgsql/' =C2=A0 =C2=A0\ > ? =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/tmp/pgdump > sed: -e: No such file or directory If you put a space after -i: sed -i '' ... It will work. The '-i' option takes an argument, and if you put a null argument right next to it, with no spaces, the shell doesn't see anything there. That is, this: -i'' Is exactly equivalent to this: -i Which means that sed is consuming the following argument as the extension...so the first '-e' is the argument to the '-i' option. -- Lars