csh problem involving nested ifs?
Peter da Silva
peter at ficc.uu.net
Mon Jul 17 00:21:11 AEST 1989
In article <3171 at quick.COM>, srg at quick.COM (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.
> 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
Oh, right. I can do:
for i in `generate a list of file names`
do
...
done
too. But what if thise file names are generated by:
find / -type f -print
Just how much stuff can *you* put in command substitutions?
To do this under csh, I basically have to do something like:
cat > foo << 'EOF'
#
do_something_with_$*
EOF
find ... | xargs csh foo
--
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter at ficc.uu.net, +1 713 274 5180. | Th-th-th-that's all folks...
Personal: peter at sugar.hackercorp.com. `-_-' | -- Mel Blanc
Quote: Have you hugged your wolf today? 'U` | May 30 1908 - Jul 10 1989
More information about the Comp.unix.wizards
mailing list