Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: History substitution Message-ID: <22956@mimsy.umd.edu> Date: 7 Mar 90 10:26:16 GMT References: <22613@adm.BRL.MIL> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 28 In article <22613@adm.BRL.MIL> MMKOISTINEN@uku.fi (MIKA KOISTINEN (PHONE 971-311796)) writes: > echo aa ab aaaa > !:gs/a/b > echo ba bb baaa >What's wrong ? The C shell documentation says: s/l/r/ Substitute l for r and g Apply the change globally, prefixing the above, e.g. `g&'. What it does not say is that `g' means `apply the change to every *word*', rather than `to every instance of ``l'' in every word'. The C shell will only substitute once in each argv[] element. (It quietly implies this with the sentence: Unless preceded by a `g' the modification is applied only to the first modifiable word. With substitutions, it is an error for no word to be applicable. In other words, everything is based on words, not on characters.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris