🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13242

Personalized Prompts

#13242
From: Scott Smith
Date: Mon, 11 Dec 1989 16:36
34 lines
2471 bytes
I have been trying to design a prompt that includes the time of day, which
I have found to be useful in some situations (for instance, if you are
waiting for a process to complete, you can glance at the command line to
see when the command was executed; and if somebody leaves a terminal idle
but logged in, you can see instantly how long they have been gone [thereby
gaioning possible justification for kicking them off and taking over that
terminal - this is somthing that I found very useful at my previous job,
where one of my co-workers frequently left terminals idle for days at a
time, but never logged out]).  In any case, what I describe is very easy
to accomplish on an iris workstation (which, I believe, runs system V
unix), but I have been unable to accomplish this on a sun workstation.
The two methods that I know of to do this on the iris are:

	set prompt = " `date +%T` : "
	set prompt = " \@T : "

Both of these definitions, if used on the iris, will produce a prompt
consisting of the current time (in the form hh:mm:ss), followed by a
space, followed by a colon.  The date is updated with each new prompt
(after every carriage return).  I have tried using these on the sun.  The
first method produces a prompt which is the date at the time that the
prompt was set and which remains fixed.  The second produces a prompt of
the form ' \@T : '.  Neither of these is very useful.  The problem seems
to be that the iris operating system evaluates the prompt every time it is
generated, while the sunOS evaluates it only once.  The only exception I
can find is the \! format, which inserts the number of the command into
the prompt, and which is continually updated.  Does anybody know of any
way to force the re-evaluation of the prompt under sun's operating system?
Is there any way to accomplish what I am trying to do?  Any suggestions
would be appreciated.  (By the way, I HAVE checked the manuals, but have
been unable to find anything helpful.)

	Scott Smith
	scott@apollo.drexel.edu
Technical Details
Message-ID: <3907@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!rice!sun-spots-request
From: scott@apollo.drexel.edu (Scott Smith)
Newsgroups: comp.sys.sun
Subject: Personalized Prompts
Keywords: Miscellaneous
Message-ID: <3907@brazos.Rice.edu>
Date: 11 Dec 89 16:36:24 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 34
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 223, message 11 of 14