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

Re: Expansion/quoting quirks



On Nov 5,  2:00pm, Thorsten Meinecke wrote:
} Subject: Expansion/quoting quirks
}
} its output will be compared to the expected output, which is on the lines
} beginning with `#%'.
} 
} 
} # Backslash ignored between single quotes (fixed in hzoli)
} #% \$x
} echo $(echo '\$x')

This one seems really strange to me.  Why is $(foo) different from `foo`
in ksh?  I think I prefer zsh's behavior, even if it isn't compatible.

    $ echo $(echo '\$x')
    \$x
    $ echo `echo '\$x'`
    $x
    $

Look, ksh isn't even consistent about it!  Why should that $ cause a
magically different behavior?

    $ echo $(echo '\x')
    \x
    $ echo `echo '\x'`
    \x
    $

(This is ksh88, I believe, in case that matters.)

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx                  Division of NCD Software Corporation
http://www.well.com/www/barts



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