Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2001 07:49:52 +1300
From:      Jonathan Chen <jonc@chen.org.nz>
To:        kjell@la3sg.net
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: ed in script
Message-ID:  <20011203074952.A11533@grimoire.chen.org.nz>
In-Reply-To: <3C0A2020.10356.110DA70@localhost>; from kmidtset@c2i.net on Sun, Dec 02, 2001 at 12:35:44PM -0000
References:  <3C0A2020.10356.110DA70@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <<XXX
> 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 <jonc@chen.org.nz>
----------------------------------------------------------------------
                        "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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011203074952.A11533>