From owner-freebsd-questions Sun Dec 2 10:49:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from chen.org.nz (tnt1-54.quicksilver.net.nz [202.89.142.54]) by hub.freebsd.org (Postfix) with ESMTP id 26D3C37B432 for ; Sun, 2 Dec 2001 10:49:24 -0800 (PST) Received: (from jonc@localhost) by chen.org.nz (8.11.6/8.11.6) id fB2Inr611733; Mon, 3 Dec 2001 07:49:53 +1300 (NZDT) (envelope-from jonc) Date: Mon, 3 Dec 2001 07:49:52 +1300 From: Jonathan Chen To: kjell@la3sg.net Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ed in script Message-ID: <20011203074952.A11533@grimoire.chen.org.nz> References: <3C0A2020.10356.110DA70@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C0A2020.10356.110DA70@localhost>; from kmidtset@c2i.net on Sun, Dec 02, 2001 at 12:35:44PM -0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Dec 02, 2001 at 12:35:44PM -0000, Kjell wrote: [...] > When I save the following sequence in the file motdclean: > ==== > ed -s /etc/motd < 3 > .,$d > i > line 1 > line 2 > . > w > q > XXX > ==== > and type the command > # sh motdclean > the deleate command is ignored, and the entire original motd is copied. The shell is trying to expand "$d", and coming back with an empty string. You could try changing that particular line to ".,\$d" and see what happens. Cheers. -- Jonathan Chen ---------------------------------------------------------------------- "Irrationality is the square root of all evil" - Douglas Hofstadter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message