zsh-users
 help / color / mirror / code / Atom feed
From: Paul Lew <paullew@cisco.com>
To: zsh-users@sunsite.auc.dk
Subject: Reduce forking overhead in precmd()
Date: Wed, 18 Sep 2002 15:31:24 -0700	[thread overview]
Message-ID: <15752.65212.28904.60591@paullew-ultra.cisco.com> (raw)

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.


             reply	other threads:[~2002-09-18 22:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-18 22:31 Paul Lew [this message]
2002-09-18 22:47 ` Clint Adams
2002-09-19  1:25   ` Paul Lew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15752.65212.28904.60591@paullew-ultra.cisco.com \
    --to=paullew@cisco.com \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).