Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utai.UUCP Path: utzoo!utcsri!utai!lamy From: lamy@utai.UUCP (Jean-Francois Lamy) Newsgroups: net.unix Subject: zero-trip foreach loops Message-ID: <2494@utai.UUCP> Date: Sun, 5-Oct-86 14:53:30 EDT Article-I.D.: utai.2494 Posted: Sun Oct 5 14:53:30 1986 Date-Received: Sun, 5-Oct-86 15:41:35 EDT Organization: CSRI, University of Toronto Lines: 23 Is there an easy way to have csh foreach loops that don't complain if the pattern given does not match any file, as may occur in the inner loop of this bit of code: foreach font (*.tfm) set fontname = `basename $font .tfm` foreach size ($fontname.*pxl) ... end end I've tried foreach size (`ls -1 $fontname.*pxl`). This stops the script from aborting, but still gives me the stupid 'No match' message. Gee, even FORTRAN does zero-trip DO loops these days... Jean-Francois Lamy AI Group, Dept of Computer Science CSNet: lamy@ai.toronto.edu University of Toronto EAN: lamy@ai.toronto.cdn Toronto, ON, Canada M5S 1A4 UUCP: lamy@utai.uucp