I think this is incorrect, but I went here to get guidance how to write functions in zsh, so I might be wrong.
alias meh="echo foo"
simply performs text substitution. That is, when Zsh encounters the text foo as the first token of the command line, it replaces it with echo foo. Nothing more. So, running:
meh foo
substitutes to
echo foo
The example alias is meh and the substitute is echo foo, shouldn't this then be: encounters meh as the first token. And the example would show meh bar -> echo foo bar, because the first token is replaced with the whole substitute. Or alternatively the example would be just meh.
I think this is incorrect, but I went here to get guidance how to write functions in zsh, so I might be wrong.
The example alias is
meh
and the substitute isecho foo
, shouldn't this then be: encountersmeh
as the first token. And the example would showmeh bar
->echo foo bar
, because the first token is replaced with the whole substitute. Or alternatively the example would be justmeh
.