From owner-freebsd-questions Wed May 30 11:57:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from fac13.ds.psu.edu (fac13.ds.psu.edu [146.186.61.98]) by hub.freebsd.org (Postfix) with ESMTP id 87C9F37B422 for ; Wed, 30 May 2001 11:57:49 -0700 (PDT) (envelope-from hawk@fac13.ds.psu.edu) Received: from fac13.ds.psu.edu (localhost [127.0.0.1]) by fac13.ds.psu.edu (8.11.3/8.11.3) with ESMTP id f4UIvih22895; Wed, 30 May 2001 14:57:45 -0400 (EDT) (envelope-from hawk@fac13.ds.psu.edu) Message-Id: <200105301857.f4UIvih22895@fac13.ds.psu.edu> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Mike Meyer Cc: "Corey Brune" , questions@FreeBSD.ORG Subject: Re: reading from batch file with ex In-Reply-To: Your message of "Tue, 29 May 2001 23:03:10 CDT." <15124.28926.954566.393875@guru.mired.org> From: dochawk@psu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 30 May 2001 14:57:44 -0400 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 mike mentioned > Corey Brune 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 < 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