From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8464 invoked from network); 18 Sep 2002 22:35:22 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Sep 2002 22:35:22 -0000 Received: (qmail 11576 invoked by alias); 18 Sep 2002 22:34:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5361 Received: (qmail 11168 invoked from network); 18 Sep 2002 22:32:00 -0000 From: Paul Lew MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15752.65212.28904.60591@paullew-ultra.cisco.com> Date: Wed, 18 Sep 2002 15:31:24 -0700 To: zsh-users@sunsite.auc.dk Subject: Reduce forking overhead in precmd() X-Mailer: VM 7.07 under Emacs 21.2.1 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.