* Don't understand why 'EQUALS' option works this way @ 2004-06-30 10:18 DervishD 2004-06-30 15:39 ` Bart Schaefer 0 siblings, 1 reply; 3+ messages in thread From: DervishD @ 2004-06-30 10:18 UTC (permalink / raw) To: Zsh Users Hi all :) Why 'print a=1' prints 'a=1' but 'print a==1' prints '1: not found'? Why the first '=' is allowed but the second is interpreted as the '=' filename expansion? All this happens, of course, only when EQUALS is 'on'. Thanks a lot in advance :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Don't understand why 'EQUALS' option works this way 2004-06-30 10:18 Don't understand why 'EQUALS' option works this way DervishD @ 2004-06-30 15:39 ` Bart Schaefer 2004-06-30 19:22 ` DervishD 0 siblings, 1 reply; 3+ messages in thread From: Bart Schaefer @ 2004-06-30 15:39 UTC (permalink / raw) To: Zsh Users On Wed, 30 Jun 2004, DervishD wrote: > Why 'print a=1' prints 'a=1' but 'print a==1' prints '1: not > found'? > > All this happens, of course, only when EQUALS is 'on'. I think you'll find that this also happens only when MAGIC_EQUAL_SUBST is on. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Don't understand why 'EQUALS' option works this way 2004-06-30 15:39 ` Bart Schaefer @ 2004-06-30 19:22 ` DervishD 0 siblings, 0 replies; 3+ messages in thread From: DervishD @ 2004-06-30 19:22 UTC (permalink / raw) To: Zsh Users Hi Bart :) * Bart Schaefer <schaefer@brasslantern.com> dixit: > > Why 'print a=1' prints 'a=1' but 'print a==1' prints '1: not > > found'? > > All this happens, of course, only when EQUALS is 'on'. > I think you'll find that this also happens only when MAGIC_EQUAL_SUBST > is on. I still don't understand. The first form, if MAGIC_EQUAL_SUBST is on, is eligible for filename expansion (the filename is '1'), but in the second form the filename would be '=1', that's all the difference. Oh, I see, the '1' could be a filename, and if it cannot be expanded, nothing occurs, but the second form expands differently, since it is the '=filename' construction. BTW, if EQUALS is off and MAGIC_EQUAL_SUBST is on, this doesn't happen, because the =filename construct is never tried, I wasn't aware of this. Thanks for your help :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-30 19:24 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-06-30 10:18 Don't understand why 'EQUALS' option works this way DervishD 2004-06-30 15:39 ` Bart Schaefer 2004-06-30 19:22 ` DervishD
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).