In zsh
this works fine:
alias foo=ls
foo
But this does not:
alias foo=ls; foo
Pressing enter an extra time is not an issue when running interactively. But when running through ssh
it suddenly becomes a problem:
% ssh zsh@server 'alias foo=ls; foo'
zsh:1: command not found: foo
Even with a newline it does not work:
% ssh zsh@server 'alias foo=ls;
foo'
zsh:2: command not found: foo
The weird thing is that zsh
knows it is aliased:
% ssh zsh@server 'alias foo=ls; alias'
foo=ls
run-help=man
which-command=whence
How do tell zsh
that the aliases should be active?
bash
andcsh
and they behaved the same way. I hope someone could explain that.