sh vs. csh

Mike Lee mikey at ontek.UUCP
Sat Jun 17 03:50:29 AEST 1989



maart at cs.vu.nl (Maarten Litmaath) writes
> mikey at ontek.UUCP (Mike Lee) writes:
> \...
> \# csh script to call up nroff on a paragraph
>
> ...
> 1) You shouldn't use csh for scripts:
> 
> 	- sh starts up faster
> 	- sh often is more powerful (csh has built-in arithmetic, arrays,
> 	  modifiers like `:t', comma-separated lists)
> 	- sh often is easier/clearer
> Well, here's a Bourne shell script:
> ...

I'll use whatever programming language I want!!!  Neener neener!!! :-)

But seriously...  All of your points are pertinent, but  I  think
the  larger  point  would  be that using a shell of any origin is
less desirable than  writing  a  function  in  C  or  some  other
compiled  language.   In  fact,  someone posted just such a thing
for adjusting paragraphs quite recently.  In any case,  the  true
limitations  of  the  csh  script I posted are not imposed by the
shell it's written in, but the quick-and-dirty approach  I  took.
In fact, I think I'll confess right now...

A) editing and adjusting a paragraph several times will cause the
   pain and itch of unsightly spaces in between words, due to
   nroff not being designed to take its output as input. That's
   a feature in nroff, but a bug in my script. A little sed-ing
   would fix it.

  B) It will soak the "B)" in paragraphs like this into the  margin
  along with with the rest of the paragraph.

Anyway, the script itself is lame, so it's perfectly  correct  to
write  in  a  lame  script  language.  Perhaps next time I'll use
interpreted cobol. %-)

IN CONCLUSION:

The issue that started this thing, how to adjust a  paragraph  in
vi,  has  been  resolved  I  believe:   Use  fmt(1)  if  you like
raggedy-ann right margins, or else use a script to call up  nroff
which  will  get  you straight margins.  So there's no excuse for
people to continue posting articles  with  unadjusted  paragraphs
anymore!!

Mike ("Don't call me Bruce") Lee
Ontek Corporation ("Better living through ontology")

mikey at ontek.uucp
...uunet!ontek!mikey
1-714-768-0301



More information about the Comp.unix.questions mailing list