nrg@nsscb.UUCP (Narotham Reddy) (06/29/89)
Can any one focus on how to include the "just time" in the prompt(PS1) with out running any additonal shell(s) in the back ground. the prompt should update the time by itself in the prompt again with out any additonal running on it's behalf in the back ground. Reddy
meissner@tiktok.dg.com (Michael Meissner) (07/12/89)
In article <827@nsscb.UUCP> nrg@nsscb.UUCP (Narotham Reddy) writes: | | Can any one focus on how to include the "just time" in the prompt(PS1) | with out running any additonal shell(s) in the back ground. the prompt | should update the time by itself in the prompt again with out any additonal | running on it's behalf in the back ground. Sure, use the GNU Bourne-Again Shell (bash). Quoting from the FEATURES file which gives minimal documentation for bash: .... Here is the comment next to the decode_prompt_string function. /* Return a string which will be printed as a prompt. The string may contain special characters which are decoded as follows: \t the time \d the date \n CRLF \s the name of the shell \w the last element of the current working directory \u your username \h the hostname upto the first `.' \# the command number of this command \<octal> character code in octal \\ a backslash */ ... The shell has several variables which are there just for controlling the behavior of the interactive shell. Here they are: ... PROMPT_COMMAND: If present, this contains a string which is a command to execute before the printing of each top-level prompt. Note that bash is currently in beta test, so you might find some bugs, or your system might not be supported yet. It is available from the usual GNU places (anonymous FTP: prep.ai.mit.edu, anonymous UUCP: Ohio state). There is a mailing list (and corresponding GNU newsgroup: gnu.bash.bug) for bash. -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner If compiles were much Internet: meissner@dg-rtp.DG.COM faster, when would we Old Internet: meissner%dg-rtp.DG.COM@relay.cs.net have time for netnews?