csh problem involving nested ifs?

Randal Schwartz merlyn at iwarp.intel.com
Mon Jul 17 23:42:03 AEST 1989


In article <3171 at quick.COM>, srg at quick (Spencer Garrett) writes:
| In article <5016 at ficc.uu.net>, peter at ficc.uu.net (Peter da Silva) writes:
| 
| -> generate_a_list_of_file_names |
| ->   while read FNAME
| ->   do
| ->     do_something_with FNAME
| ->   done
| -> 
| -> is second nature. And it's impossible in csh without massive inconvenience.
| -> By comparison, having TEST and EXPR builtin is a minor optimisation.
| 
| What are you talking about?  It's easy and much more natural under csh.
| 
| foreach fname (`generate_a_list_of_file_names`)
| 	do_something_with_fname
| end

Unless (and there are far far far too many "unless"-es with CSH...)

generate_list_of_file_names returns more than 5120 characters, *or*
the resulting list can't be globbed properly (I just got bit on
/bin/*... try it... it bites the big one on "/bin/[") *or* some other
combination of events that I'll probably run across tomorrow...
Gaaaaccckkk!

Gimme /bin/sh any day.  True parsing.  No nonsense.

Of course, as soon as /bin/ksh becomes *the* standard, I'll like it
much better.  Until then, I'm stuck with csh for my top level shell
because of command history and job control, but all my scripts (well,
non-Perl scripts :-) are /bin/sh.

Just an old-time UNIX hacker,
-- 
/== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\
| on contract to Intel, Hillsboro, Oregon, USA                           |
| merlyn at iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn	         |
\== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/



More information about the Comp.unix.wizards mailing list