From: Paul Duncan <duncanpa@engr.orst.edu>
To: munafo@gcctech.com
Cc: 
Bcc: 
Subject: More Gnut Fun!
Reply-To: 

Okay, this one is a bit more fun.  This patch adds  multisearch
variables, newline support and backtick interpolation to the prompt
string.  Also, it renames the "lclear" to the more logical "remove"
(with rm as an alias).  Sorry about the mix, but I forgot to send
one as a separate patch.  Anyways, the new prompt stuff works as
follows:

Newlines are inserted with a \n string, and backslashes are \\.  If
you want one-time backslash interpolation, don't escape them.  For
example, you could put a set prompt `hostname`: $(HOSTS)> and it'll
just interpolate the backtick stuff when it sets the prompt, or
you escape the backticks and have it interpolate each time it 
displays the prompt.  Here's my prompt string now:

set prompt \`date +%Y%m%d-%H%M%S\`, \`df -m |grep mp3 |awk '{print $4;}'\`M available,  ${HOSTS} hosts, ${FILES} files, ${RESPONSES} responses\n${MULTI_COUNT} searches [${MULTI_RESPONSES}]>

Which brings me to the new MULTI_COUNT and MULTI_RESPONSES prompt
variables.  MULTI_COUNT just returns the nubmer of active searches,
and MULTI_RESPONSES returns a comma-delimited list of the number of
responses per search.  If the search doesn't have an id yet, then
it looks a little different...  Well, here's what it looks like on
my system as an example:

(before the user types list...  MULTI_RESPONSES is in the brackets):

20001101-073430, 99M available,  3093 hosts, 194 files, 205 responses 
4 searches [?:103, ?:0, ?:0, ?:106]> 

(after the user types list):

20001101-073700, 99M available,  3116 hosts, 12.96K files, 314 responses 
4 searches [1:154, 2:0, 3:0, 4:174]> 

So, once it assosiates an ID with a search, it puts the ID next to
the number of results.


-- 
Paul Duncan <duncanpa@engr.orst.edu>    Network Support
http://www.pablotron.org/               Botany and Plant Pathology
pabs on #e (OPN and EFNet IRC)          Oregon State University
OpenPGP Key ID: 0x82C29562
