Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is there a kind of function factory in zsh?
- X-seq: zsh-users 15107
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Leander Jedamus <ljedamus@xxxxxxxxxxxxxx>
- Subject: Re: Is there a kind of function factory in zsh?
- Date: Tue, 8 Jun 2010 17:34:21 +0200
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=i1FSDQIXukF8MR8zOKh6FydIYgT7T4cuVSd6nZ3iobQ=; b=SKM/QNwVPAPDPelW3dOv9UGawCfNjXbTF/7zJqlcEFsOdfXwBW0YM8B6OyZx+GOnSx 8c0wUBaZAPXGRgLIc04vJup/jdVIXiKFlGt6M3HwKciOx6MgPAGKgJUDsRWUngM/iaD7 Ilg/qds0Cf/TW727+BXBnX5/Gpcx58F3LjJ7g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=gxxRYTaO41J2xtjDZy0ynpbxVSa0S6uRVb2Nlyb+1wsn6UqpiRooo9rWMR8y+3WTFc p5J7lkN/twu9/YQG+yCi/WoPNvkhIVYHClrF24XRKkP612T4pF+DDd64cx/DRG8XrubH GurCMaLlCiu59WzJ+Jt+8oAx6s+UPpi2WPbDo=
- In-reply-to: <4C0E612E.8060604@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4C0E612E.8060604@xxxxxxxxxxxxxx>
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