Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!corton!mirsa!celeste.inria.fr!colas From: colas@celeste.inria.fr (Colas Nahaboo) Newsgroups: comp.windows.x Subject: Inserting replies in xmh (Was: xmh bug -- more) Message-ID: <11427@mirsa.inria.fr> Date: 23 May 91 16:09:51 GMT Article-I.D.: mirsa.11427 References: <9105022125.AA24441@osf.osf.org> Sender: news@mirsa.inria.fr Organization: Koala Project, Bull Research France Lines: 32 Nntp-Posting-Host: celeste.inria.fr In article <9105022125.AA24441@osf.osf.org>, vania@osf.ORG (Vania Joloboff) writes: > when > you insert the message you immediately want to delete the useless header > lines. I am too lazy to write an awk script to remove them. What about a perl script? this is the one I use... I am NOT a perl GURU, so my perl style is surely bad. However, real perl hackers will surely start a contest for the smallest perl script doing this job :-) #!/usr/local/bin/perl eval "exec /usr/local/bin/perl -S $0 $*" if $running_under_some_shell; # this emulates #! processing on NIH machines. # (remove #! line above if indigestible) eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift; # process any FOO=bar switches $, = ' '; # set output field separator $\ = "\n"; # set output record separator while (<>) { chop; # strip record separator $OK = 1; if ($. == 1 .. /^$/) { $OK = 0; } if ($OK == 1) { print '> ' . $_; } }