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

aliases in zsh -c and eval



Hiya,

it looks like aliases defined in `zsh -c` are not expanded in
there:

$ zsh -c 'alias foo=echo
foo bar'
zsh:2: command not found: foo

Those defined for instance in ~/.zshenv are expanded. And:

$ zsh -c 'alias foo=echo
eval foo bar'
bar

It looks like zsh is the only one out here. (with bash you need
bash -O expand_aliases).

Same with eval:

$ (eval 'alias foo=echo
subsh quote> foo bar')
zsh: command not found: foo
$ (eval 'alias foo=echo
eval foo bar')
bar

This time, ksh93 does behave like zsh.

-- 
Stephane



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