![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting current work directory in Command Prompt | MeganP | UNIX for Dummies Questions & Answers | 3 | 07-20-2007 02:49 PM |
| Adding # minutes to current time... | gptavares | UNIX for Advanced & Expert Users | 7 | 06-25-2007 04:10 PM |
| Setting the current path in the command prompt in (t)csh | reborg | Answers to Frequently Asked Questions | 0 | 10-10-2006 04:02 PM |
| Substituting variable with current time | jhansrod | Shell Programming and Scripting | 4 | 11-20-2005 08:20 PM |
| current directory as part of the csh prompt | jamesloh | Shell Programming and Scripting | 3 | 08-28-2002 02:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help setting PS1 prompt to include current time
Hi,
I'm using the ksh shell and I'd like to set my PS1 prompt on an AIX system to include, amongst ther things, the current time. This was my best effort: export PS1=$(date -u +%R)'${ME}:${PWD}# ' but this only sets the time to the value when PS1 is defined and the time value doesn't actually change after that. Any one got any ideas how to achieve this? I've tried searching the forum but can't find anything. Thanks Gareth |
|
||||
|
PWD, RANDOM and some other environment variables are defined by the shell to point to a function. I don't know of a function defined as a shell symbol that returns date & time.
In the korn shell try: Code:
PS1='$RANDOM' |
|
||||
|
Hello,
just a 'stupid' question I am using an older ksh (ksh88) and from there I enter into tcsh .... where should I place this code (and how should it be re-written, too), if I want to have it create env variables .... maybe by including it in .cshrc or some other startup files (.login or other)? Well all that I was thinking of doing was to be able to have these env vars available by the time one of the alias statement inside my .cshrc executes, in such a way I could use the env var contents and place it onto the title bar of my xterm window. Result being I should then get a clock displayed in the title bar. Do you have any advice or ideas? Thanks for all! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|