zsh-users
 help / color / mirror / code / Atom feed
* Reduce forking overhead in precmd()
@ 2002-09-18 22:31 Paul Lew
  2002-09-18 22:47 ` Clint Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Lew @ 2002-09-18 22:31 UTC (permalink / raw)
  To: zsh-users

I have a precmd() that I would like to augment to include source
control freeze info (we use clearcase, a freeze will change the way
files are represented).

precmd ()
{
    ....

    if [[ $CLEARCASE_ROOT != "" ]]; then
        RPROMPT=${RPROMPT:s/"%S f %s "//}
        cleartool catcs | grep time > /dev/null
	if [[ $? == 0 ]]; then
	    RPROMPT="%S f %s %$RPROMPT"
	fi
    fi
}

Basically the "cleartool catcs" command is required, if its output
contain 'time', then there is a freeze condition which I will modify
the RPROMPT to include an indicator.

However, this still added 2 more forks per command and the response is
not that desirable.  Any way to speed this up, for example, is there
a way in zsh to replace the 'grep' above?

Thanks in advance.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-19  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-18 22:31 Reduce forking overhead in precmd() Paul Lew
2002-09-18 22:47 ` Clint Adams
2002-09-19  1:25   ` Paul Lew

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).