Operating System - HP-UX
1837412 Members
3670 Online
110116 Solutions
New Discussion

Re: How to set POSIX PS1 variable to display date and time in the prompt

 
louisji2008
Regular Advisor

How to set POSIX PS1 variable to display date and time in the prompt

How to set POSIX PS1 variable to display date and time in the prompt and the date and time could change dynamically. I set PS1 as below, but the date and time doesn't change. export PS1=`whoami`@`hostname`-$(date +%x,%R)['$PWD']" $ "

 

 

P.S. this thread has been moved from HP-UX > Generalto HP-UX > languages - HP Forums Moderator


How time flies~~~
1 REPLY 1