From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13651 invoked by alias); 19 Jan 2013 18:02:10 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17593 Received: (qmail 28717 invoked from network); 19 Jan 2013 18:02:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.215.170 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=9LEaN82aZCBbepHdkJvNP92e1HDbNL8fxoEVoJvO3X0=; b=ZEPTn/5KNZsWbWyq4/GUUTD4J0oLVQkGMrbwZZFMq4vmnmDAL4AgUf3S7idBMRETIp J2kRVccxzTyExtURVc1A2BuVxkaC7q3HlzZQRS8X81sPl94We4Y5aqw+PN/2SF/RUR5R V0MR+y3IJrNtsCSWtiHH7ZrwfzjTrO6tzjolaF1i8LL2lIM/ttDi1xgyC4zyx5XLOxN8 hShlROKysiZcbNbqV1lMJpao3uQvdLZlZGzzS157aY/xuD+/PW9sQMm9X0isD826457x dgBg/ZcsVzmm6++XVdjBCM7HG55ywtlnF3RKvHLCHytL4sFCsHuTkGOt3a27G7UWVh+l KSSw== X-Received: by 10.14.223.200 with SMTP id v48mr40340127eep.24.1358617089095; Sat, 19 Jan 2013 09:38:09 -0800 (PST) Date: Sat, 19 Jan 2013 17:38:07 +0000 From: Stephane Chazelas To: Ray Andrews Cc: zsh-users@zsh.org Subject: Re: zsh functions not playing nice. Message-ID: <20130119173807.GB7039@chaz.gmail.com> Mail-Followup-To: Ray Andrews , zsh-users@zsh.org References: <50FAD0AF.60506@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50FAD0AF.60506@eastlink.ca> User-Agent: Mutt/1.5.21 (2010-09-15) 2013-01-19 08:58:23 -0800, Ray Andrews: > Gentlemen, > > I can't get this sort of thing to work: > > $ nice -n 20 some-zsh-function > > returns: > > "nice: some-zsh-function: No such file or directory. > > I can use 'nice' with any builtin or binary or script, just not with > a function. > How do I solve that? [...] ~$ type nice nice is /usr/bin/nice There's no way it can know about a zsh function which is something internal to the shell. It *executes* a command. So what you think is a builtin is the command version of it in /bin or /usr/bin: ~$ strace -fe execve nice echo test execve("/bin/echo", ["echo", "test"], [/* 40 vars */]) = 0 What you could do is: some-zsh-function & renice $!; fg Note that it would run that function in a subshell. -- Stephane