* Add contents in existing precmd
@ 2003-01-19 14:00 Bruno Bonfils
2003-01-19 18:58 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Bruno Bonfils @ 2003-01-19 14:00 UTC (permalink / raw)
To: zsh-users
Hi all,
I just want to know how to add some functions in a existing precmd. I
asked on #zsh, someone (sorry I don't remember who) tell me to use
this :
eval "function precmd () {
$functions[precmd]
title $HOST $PWD
}"
but the problem is I have :
% echo $functions[precmd]
...
title laptop /home/asyd
how to prevent $HOST and $PWD will be replace with value ?
Thank you a lot.
--
Bruno Bonfils
http://www.debian-fr.org/ http://www.zshwiki.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Add contents in existing precmd
2003-01-19 14:00 Add contents in existing precmd Bruno Bonfils
@ 2003-01-19 18:58 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2003-01-19 18:58 UTC (permalink / raw)
To: zsh-users
On Jan 19, 3:00pm, Bruno Bonfils wrote:
}
} how to prevent $HOST and $PWD will be replace with value ?
You can switch back and forth between double and single quotes:
eval "function precmd () {
$functions[precmd]"'
title $HOST $PWD
}'
Or you can put backslashes before the individual dollar signs, but
if there are more than a few of them that might get tiresome:
eval "function precmd () {
$functions[precmd]
title \$HOST \$PWD
}"
There are probably half a dozen other ways to do it as well.
This is all very basic shell syntax, with which you ought to become
familiar ...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-19 18:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-19 14:00 Add contents in existing precmd Bruno Bonfils
2003-01-19 18:58 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).