Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fg jobs info
- X-seq: zsh-users 11802
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: fg jobs info
- Date: Mon, 3 Sep 2007 08:38:54 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <070902105953.ZM22915@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070902154306.35880.qmail@xxxxxxxxxxx> <070902105953.ZM22915@xxxxxxxxxxxxxxxxxxxxxx>
On Sun, Sep 02, 2007 at 10:59:53AM -0700, Bart Schaefer wrote:
[...]
> fg() {
> # Obviously this needs error handling added, etc.
> typeset -g fgjob=$(jobs $*)
> builtin fg $*
> }
>
> and then stuff the title bar (or whatever) with the something parsed
> out of $fgjob.
I'd like to point out that $* is not the right way to pass
parameters around. $* strips the empty arguments.
You want "$@" (with quotes) as with the other shells.
Also, in zsh (contrary to ksh and bash), typeset is a builtin
parsed like any other builtin, so in the typeset command above,
the command substitution will be word spit, you want:
typeset -g fgjob="$(jobs "$@")"
Or better
typeset -g fgjob
fgjob=$(jobs "$@")
not sure the typeset -g is needed there.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author