LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-18-2005, 09:33 AM   #1
rpb
Member
 
Registered: Mar 2005
Location: the thrid rock from the sun
Distribution: Red Hat 8, FC 3
Posts: 31

Rep: Reputation: 15
display time in the prompt


hi,

the following string displays time in the prompt:

set prompt = "%{\033[29m%}%B[%@]$ "

as follows:

[7:04pm]$

now i want the time in 24 hours format, without any am, pm etc. that is, say

[19:04]$

anybody knows how?

thanks,
rpb

Last edited by rpb; 05-18-2005 at 09:36 AM.
 
Old 05-18-2005, 05:03 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
The answer can be found in the Bash Prompt HOWTO. Change %@ to %t (or possibly \t as in the HOWTO) for time in 24 hour format.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
about time display in redhat 9 yjiang Linux - General 1 10-27-2004 12:02 AM
Display the date and time from another time zone lothario Linux - Software 4 07-31-2004 04:27 PM
Telling ls to display one screen at a time rl5 Linux - Newbie 3 03-23-2004 08:29 PM
how set system time by command prompt? yenonn Linux - Newbie 9 08-25-2003 07:40 PM
time as shell prompt chandan Linux - Newbie 3 07-04-2003 02:05 AM


All times are GMT -5. The time now is 06:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration