Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: variable containing the current command
- X-seq: zsh-users 2352
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Michael Barnes" <mibarnes@xxxxxx>, zsh-users@xxxxxxxxxxxxxx
- Subject: Re: variable containing the current command
- Date: Mon, 31 May 1999 05:46:32 +0000
- In-reply-to: <19990526185039.A10504@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <19990526202314Z13566-3056+232@xxxxxxxxxxxxxxxxxxxx> <19990526174044.A7264@xxxxxxxxxxxxxxxxxxxx> <990526221741.ZM22768@xxxxxxxxxxxxxxxxxxxxxxx> <19990526185039.A10504@xxxxxx>
On May 26, 6:50pm, Michael Barnes wrote:
} Subject: Re: variable containing the current command
}
} preexec () {
} word=$*
} word=$word[(w)0]
} case $word in
} cd*|ls*) ;;
} *) print -Pn "\e]2;%n@%m $word \a" ;;
} esac
} }
}
} for some reason $1 does not get set properly under 3.0.5 extended so I
} manually parse it out from $*, dunno about newer versions.
I'm not sure why you say $1 does not get set properly. $1 gets set to
the entire command line, which is exactly how it's documented:
`preexec'
Executed just after a command has been read and is about to be
executed. If the history mechanism is active, the string to be
executed is passed as an argument. ^^^^!!!!!!^^^^^^
^^^^^^^^^^^^^^^^^^^^^^!!^^^^^^^^^
Is that in fact what you see, or is there a bug that I can't reproduce?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author