LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 08: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 08:36 AM.
 
Old 05-18-2005, 04:03 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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



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-26-2004 11:02 PM
Display the date and time from another time zone lothario Linux - Software 4 07-31-2004 03:27 PM
Telling ls to display one screen at a time rl5 Linux - Newbie 3 03-23-2004 07:29 PM
how set system time by command prompt? yenonn Linux - Newbie 9 08-25-2003 06:40 PM
time as shell prompt chandan Linux - Newbie 3 07-04-2003 01:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:26 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
Open Source Consulting | Domain Registration