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

Re: alias -- do not pass args



* Roman Cheplyaka [2006.09.11 15:00]:
> I want to define alias which would /not/ pass its args to program.
> E.g.
> $ alias foo='echo lol'
> $ foo a b
> should just print lol, not "lol a b". How can I do this?

Well in this case the alias does not pass its args
to the program. The alias is just expanded and the
whole line is passed to 'echo' by the shell.

You could obtain what you want with a shell
function:

% foo() { echo lol; }
% foo a b
lol
% 

It doesn't make much sense to do it with an alias
anyway. Unless I'm missing something...

-- 
JR



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