Reputation: 1400
I am trying to configure PS1
to display the current time, here is my current variable
me@host:~/Downloads$ env | grep -i 'ps1'
PS1=\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
The result planed is
me@host; 09:00 AM: ~/Downloads$
\T is expanded into the current time in 12-hour format,
Configure it temporally
me@host:~/Downloads$ export PS1="\[\e]0;\u@\h;\T: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$"
Unfortunately, the prompt does not change.
What' s the problem with my usage?
Upvotes: 0
Views: 230
Reputation: 16662
debian_chroot
sectionsTry something like:
PS1='\[\e]0;\u@\h;\T: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\];\T:\[\033[01;34m\]\w\[\033[00m\]\$ '
Upvotes: 1