Operating System - HP-UX
1827424 Members
3937 Online
109965 Solutions
New Discussion

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