zsh bug of the day

Aug 29, 2005 18:11

This was confusing the crap out of me for a while, but I'm still pretty sure this is a bug ( Read more... )

Leave a comment

Comments 6

vixi August 30 2005, 01:36:05 UTC
fix google's scientific calculator!

Reply


lauramiller August 30 2005, 02:02:57 UTC
uhm pete
need i reiterate what a dork you are? :p

Reply


unintuitive, but maybe correct thepsychotron August 30 2005, 13:10:27 UTC
I did a quick look through the bash man page and found:

"The first word of each simple command, if unquoted, is checked to see if it has an alias. If so, that word is replaced by the text of the alias."

"Aliases are expanded when a command is read, not when it is executed."

"Aliases are expanded when a function definition is read, not when the function is executed, because a function definition is itself a compound command."

Actually substituting the name of the function in the function declaration would seem a reasonable interpretation of these rules. It may not be possible to tell at the time of the substitution whether it is a function declaration or a simple command because the substitution itself could change the meaning of the statement to one or the other. I haven't yet looked at what the documentation for other shells say on this.

Reply


lilbeef August 31 2005, 17:18:14 UTC
fun fact for the day: did you know that 404 is an infinite loop?

Reply

petef August 31 2005, 17:21:50 UTC
I learned that in school on Feb 30th.

Reply


birdsonthewire September 9 2005, 02:47:22 UTC
yea that really *was* confusing....sure glad you cleared that up.....

*crazyface*

Reply


Leave a comment

Up