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

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



You could build a function factory with eval, but in this case there is an
even easier possibility:

function ssh telnet su bash zsh tcsh {
	set_title "$0 $@"
	{
		command $0 "$@"
	} always {
		cd .
	}
}

This defines a function for ssh, telnet etc., $0 always evaluates to the name
by which the function was called.

--derf

Attachment: signature.asc
Description: Digital signature



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