zsh-workers
 help / color / mirror / code / Atom feed
* aliases in zsh -c and eval
@ 2014-11-27 21:22 Stephane Chazelas
  2014-11-27 21:25 ` Stephane Chazelas
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephane Chazelas @ 2014-11-27 21:22 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-27 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27 21:22 aliases in zsh -c and eval Stephane Chazelas
2014-11-27 21:25 ` Stephane Chazelas
2014-11-27 21:35 ` Mikael Magnusson
2014-11-27 21:35 ` Peter Stephenson

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).