[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tilde operator
Harald and the list,
You all have reminded me that many eyes make it easier to find bugs in
one's thinking. I actually feel kind of dumb since I knew the details
(one-scan rule, eval to re-scan, quoting pattern when assigning to a
variable - this flaw was only in the posted example code), I just
didn't put them together right.
As I replied to Byron, based upon his advice, this was the "solution"
to make the middle example print 0:
S rittle@supra; h='x*'; echo <={eval '~' x1 $h}
0
Although I didn't mention it, before I mailed the list, I had tried:
S rittle@supra; h='x*'; echo <={eval ~ x1 $h}
/usr/users/rittle: Permission denied
At the time, it just didn't seem right to have to quote '~' (I wont
even claim to have thought about even trying that), but now it makes
perfect sense. Harald, I think you said it best (paraphrased),
~``eval: Here be dragons''.
Thanks to:
Harald Hanche-Olsen <hanche@math.ntnu.no>
Bill Trost <trost@cloud.rain.com>
Byron Rakitzis <byron@rakitzis.com>
<rsc@plan9.bell-labs.com>
Regards,
Loren