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

Re: Is there a kind of function factory in zsh?



On 8 June 2010 17:26, Leander Jedamus <ljedamus@xxxxxxxxxxxxxx> wrote:
> Hi!
>
> I wonder if I could use a pattern for creating fucntions, that nearly look
> the same.
> Background is I have to write a function for ssh, telnet, su, bash, zsh,
> tcsh and so on that all look like (for example for the ssh command):
> ssh()
>    {
>      set_title "ssh $@"
>      {
>        command ssh "$@"
>      } always {
>        cd .
>      }
>    };# ssh()
> How can I avoid writing all that code again and again?
>
> Thanks in advance
> Leander Jedamus
>

ssh bash bing foo bar baz()
{
  echo $0
}


-- 
Mikael Magnusson



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