Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh functions not playing nice.
- X-seq: zsh-users 17593
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: zsh functions not playing nice.
- Date: Sat, 19 Jan 2013 17:38:07 +0000
- Cc: zsh-users@xxxxxxx
- 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==
- In-reply-to: <50FAD0AF.60506@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Ray Andrews <rayandrews@xxxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <50FAD0AF.60506@eastlink.ca>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author