Path: utzoo!utgpu!watserv1!watmath!iuvax!mailrus!tut.cis.ohio-state.edu!oz.cis.ohio-state.edu!jgreely From: jgreely@oz.cis.ohio-state.edu (J Greely) Newsgroups: comp.unix.questions Subject: Re: Simple question... Message-ID: Date: 2 Dec 89 15:18:08 GMT References: <3013@uceng.UC.EDU> Sender: news@tut.cis.ohio-state.edu Reply-To: J Greely Organization: Ohio State University Computer and Information Science Lines: 26 In-reply-to: schriste@uceng.UC.EDU's message of 2 Dec 89 13:18:01 GMT In article <3013@uceng.UC.EDU> schriste@uceng.UC.EDU (Steven V. Christensen) writes: >Excuse the simple question, but I have a bunch of shar files that >I want to unshar. Unfortunately all 20+ have the mail headers on them. >In SED, how would I pipe the files to remove everything before the >"#!/bin/sh" ? Strictly speaking, you need to remove everthing before the first line that begins with either "#" or ":", since many shar programs produce the latter. sed -n '/^[#:]/,$ p' is the command you're looking for. > Also, how would I get everything between the "#!/bin/sh" >and the "exit 0" at the end (for those mailers which append a .sig)? You don't. The "exit 0" is there specifically to prevent the shell from reading the signature. Of course, to beat a dead horse, you can do it in perl like this: perl -ne 'print if /^[#:]/..eof();' -=- J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)