zsh: passing parameters (args) to aliases?

zsh: passing parameters (args) to aliases?

Post by Jeremy Mathe » Thu, 22 Aug 1996 04:00:00



I recently switched from tcsh to zsh and am so far pretty impressed.

However, I can't figure out how to pass args in aliases like  csh does.
That is, I can't find the eqv of: alias l "last \!* | head"

Eventually, I figured out how to do it with a shell procedure.  Is this the
stock answer to the question?  I.e., does the dialog go:

        Newbie: How do I define an alias with parameters in zsh?

        Zsh fanatic: You don't.  Use shell procedures!

Have I got it right?

************************************************************************
Smiley captioned version available for the humor-impaired.
Email for price and availability ;-)


          hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer

 
 
 

zsh: passing parameters (args) to aliases?

Post by Richard Colema » Fri, 23 Aug 1996 04:00:00



> I recently switched from tcsh to zsh and am so far pretty impressed.

> However, I can't figure out how to pass args in aliases like  csh does.
> That is, I can't find the eqv of: alias l "last \!* | head"

> Eventually, I figured out how to do it with a shell procedure.  Is this the
> stock answer to the question?  I.e., does the dialog go:

>    Newbie: How do I define an alias with parameters in zsh?

>    Zsh fanatic: You don't.  Use shell procedures!

> Have I got it right?

That's correct.  Use shell functions.

Richard Coleman


 
 
 

1. Passing args to command aliases in ksh?

I have an alias in ksh:  under='\irc $IRCNICK $UNDERSERVLIST' and I
want to be able to set the $IRCNICK on the fly so that typing "under
<nick>" would connect with the nick I typed. How do I do this?

I've tried replacing the $IRCNICK syntax with the \\!^ that works in
csh but not ksh.

What i want to do basically is to pass an argument to a command alias
but not at the end of the alias, in the middle instead.

Anyone wanna tackle that? :) hehe

If its not too much trouble, if you reply to this can ya send a copy

Thanks loads! :)
Greg Layne

2. Windows vs Linux

3. alias: passing args

4. Arg list too long

5. Giving parameters in aliases under zsh

6. LinuxRouter doesn't boot!!

7. parameter passing in ksh alias

8. UHC

9. passing parameters to alias

10. How to pass parameters to an alias

11. ksh and passing parameters to an alias

12. Passing parameters to an alias in ksh ...under AIX

13. passing parameters to aliases in .kshrc