Path: utzoo!attcan!uunet!fernwood!decwrl!ucbvax!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!cwjcc!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: The *ART* of Computer Programming Message-ID: <1990Mar10.051637.2946@NCoast.ORG> Date: 10 Mar 90 05:16:37 GMT References: <1990Feb26.234217.23251@aucs.uucp> <732@sppy00.UUCP> <25eb63c7.6a42@polyslo.CalPoly.EDU> <12533@nigel.udel.EDU> <1990Mar2.184550.5037@oracle.com> <655@sagpd1.UUCP> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: North Coast Public Access UN*X, Cleveland, OH Lines: 39 As quoted from <655@sagpd1.UUCP> by jharkins@sagpd1.UUCP (Jim Harkins): +--------------- | In article emv@math.lsa.umich.edu (Edward Vielmetti) writes: | >My "one time" programs tend to be 80 characters or less and are | >generally written as shell pipelines or perl one-liners. | | These are the worst, I find that 6 months later I spend more time trying to | figure out how to use that 1-liner I left laying around than it would take | me to write another to do the same thing. The original assertion stands. +--------------- Not necessarily. My one-liners---with one exception case---are like Ed's; but they're *literally* one-shot. I type them in at the shell prompt, they run, that's it (unless I use "fc -e"; rare). The one exception case? The equivalent of aliases, for use within programs which don't run csh or ksh or to allow quick modification to e.g. menus. For example, I have a large number of entries on my MultiView menu which point to scripts in $HOME/bin; those scripts are one-liners. So my MultiView menu runs a program called "netnews", which runs either "emacs -f gnus" or "rn" or "tn". The other case is used in program development at telotech: a command called (for example) "acpl" which does ". asqlinit; exec ACPL ${1+"$@"}"---"asqlinit" is a script which sets up the Accell (tm Unify Corp.) environment, and is sourced by any command or script which wants to use Accell on telotech. Both of these sub-cases are always very simple. And yes, this applies with Perl as well. Not as often, since I'm not as "up" on Perl as, say, Randal (or Larry), but I do use it with such interactive one-liners. And if I *do* write something complex, it gets commented. You see, I *have* had the problem of going back and trying to figure out what I was smoking when I wrote *that* bit of code. [ ;-) ] ++Brandon -- Brandon S. Allbery (human), allbery@NCoast.ORG (Inet), BALLBERY (MCI Mail) ALLBERY (Delphi), uunet!cwjcc.cwru.edu!ncoast!allbery (UUCP), B.ALLBERY (GEnie) BrandonA (A-Online) ("...and a partridge in a pear tree!" ;-)