Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: sh `for' (was Help with strings in Bourne shell) Message-ID: <17197@mimsy.UUCP> Date: 30 Apr 89 05:51:50 GMT References: <19311@adm.BRL.MIL> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 17 In article <19311@adm.BRL.MIL> mchinni@pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) writes: >The problem is with the "for" loop. The "for" construct uses a list >of arguments which are words separated by tabs/spaces. Not quite: `for' splits its list according to $IFS. For instance: IFS=@ l="color = red@size = big" for i in $l; do wc $i; done (I use `wc' as a program that shows exactly what its arguments are; echo puts each argument on the same line, which makes things hard to see.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris