Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!texsun!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.unix.wizards Subject: Re: csh problem involving nested ifs? Message-ID: <5021@ficc.uu.net> Date: 16 Jul 89 14:21:11 GMT References: <20243@adm.BRL.MIL> <5016@ficc.uu.net> <3171@quick.COM> Organization: Xenix Support, FICC Lines: 41 In article <3171@quick.COM>, srg@quick.COM (Spencer Garrett) writes: > In article <5016@ficc.uu.net>, peter@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@ficc.uu.net, +1 713 274 5180. | Th-th-th-that's all folks... Personal: peter@sugar.hackercorp.com. `-_-' | -- Mel Blanc Quote: Have you hugged your wolf today? 'U` | May 30 1908 - Jul 10 1989