Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Don't understand why 'EQUALS' option works this way



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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/



Messages sorted by: Reverse Date, Date, Thread, Author