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

Is there a kind of function factory in zsh?



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



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