Date: Wed, 30 May 2001 14:57:44 -0400 From: dochawk@psu.edu To: Mike Meyer <mwm@mired.org> Cc: "Corey Brune" <brune@sdf.lonestar.org>, questions@FreeBSD.ORG Subject: Re: reading from batch file with ex Message-ID: <200105301857.f4UIvih22895@fac13.ds.psu.edu> In-Reply-To: Your message of "Tue, 29 May 2001 23:03:10 CDT." <15124.28926.954566.393875@guru.mired.org>
next in thread | previous in thread | raw e-mail | index | archive | help
mike mentioned > Corey Brune <brune@sdf.lonestar.org> types: > > try: > > ex < filename > Or try a here document if you really want it in place (and I changed > the s to a c to make it easier to read): > ex <<EOF > 1c > /compat/linux/bin/sh > . > w > q > EOF ahh, that's what I'm looking for--I'd like to keep it all in one file (so I can lose it all at once :) > Though you'd probably be a *lot* better off using sed for this. > mv script script.old > sed '1s;^.*$;#!/compat/linux/bin/sh; < script.old > script > > or maybe that should be: > > sed '1c There's something far back in my memories trying to claim that there was something dangerous about using sed this way, but i'ts beyond my current ability to remember . . . -- Prof. Richard E. Hawkins, Esq. /"\ ASCII ribbon campaign dochawk@psu.edu Smeal 178 (814) 375-4700 \ / against HTML mail These opinions will not be those of X and postings Penn State until it pays my retainer. / \ 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?200105301857.f4UIvih22895>