Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 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 * *********************************************************************