🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #17163

Re: Binhex section delimiters

#17163
From: Earle R. Horton
Date: Fri, 03 Jul 1987 23:44
43 lines
2389 bytes
In article <278@intvax.UUCP>, loucks@intvax.UUCP (Cliff Loucks) writes:
> cat $1 | sed -n -e '/ /d' -e '/	/d' -e '/^---$/d' -e '/./p' > $1.hqx
> rm $1
>                      ^         ^                 ^           ^
>                      remove    remove            remove      pass all
>                      lines     lines             lines       other lines
>                      with a    with a            containing  through to
>                      space     tab               only "---"  the output

cat $HOME/thisfile $* |\
         sed -n -e 1,2p -e '/ /d' -e '/	/d' -e '/^---$/d' -e '/./p' > $1.hqx

contents of $HOME/thisfile:
(This file...)

--EOF--

The trick is to do all the files at once, and still get the crucial
"(This file...)", while using the minimal number of programs/CPU time.
"$*" allows multiple files to be input after "thisfile", and "-e 1,2p"
prevents the header lines from being stripped out.  I never use
binhex, but the header lines are required for xbin.

I would like to see someone accomplish this task with
   (a)   one UNIX or VMS program in a shell script  (100 points)
   or
   (b)   no file "thisfile"  (40 points)
   or
   (c)   an alias  (30 points)

Only pre-existing programs which come with the distribution tapes
are allowed in (a).  Only single line shell scripts or aliases are
allowed, although continuation by "\" to improve readability is OK.
Winners in all categories will be invited to the annual Horton
Barbecue and Potluck, at my house later this month.

(I prefer to do the "rm" by hand.)

Earle
-- 
*********************************************************************
*Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755   *
*********************************************************************
Technical Details
Message-ID: <6582@dartvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!cmcl2!rutgers!ucla-cs!zen!ucbvax!decvax!dartvax!earleh
References: <3977@utai.UUCP> <278@intvax.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!cmcl2!rutgers!ucla-cs!zen!ucbvax!decvax!dartvax!earleh
From: earleh@dartvax.UUCP (Earle R. Horton)
Newsgroups: comp.sys.mac
Subject: Re: Binhex section delimiters
Message-ID: <6582@dartvax.UUCP>
Date: Fri, 3-Jul-87 19:44:35 EDT
Article-I.D.: dartvax.6582
Posted: Fri Jul  3 19:44:35 1987
Date-Received: Sat, 4-Jul-87 17:19:10 EDT
References: <3977@utai.UUCP> <278@intvax.UUCP>
Organization: Negative Entropy Research and Development Society
Lines: 43
Summary: showing off