The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
date command help bsandeep_80 UNIX for Advanced & Expert Users 4 04-30-2008 12:00 PM
Help with a Date Command !!! kumarsaravana_s UNIX for Dummies Questions & Answers 1 05-28-2007 12:33 PM
Date Command -1 greengrass UNIX for Dummies Questions & Answers 4 01-24-2007 03:18 PM
date command vshyam4949 UNIX for Dummies Questions & Answers 2 01-30-2006 08:40 AM
Date Command saldana UNIX for Dummies Questions & Answers 2 02-05-2004 08:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-01-2008
Registered User
 

Join Date: Nov 2007
Posts: 22
date command op formation

Dear All

I am facing below mention problem plz suggest me solution.

Op of date command:

> date
Tue Jan 1 12:17:52 IST 2008

Now i want Jan 1 12: or Jan 1 12 op in some another variable.

I had tried awk but if give me problem when there is date comes in 2 digit i.e. greater that 9. at that time op of date commnad contain only 1 space between Day month and date.
i.e. If date < 10 then op:Tue Jan 1 12:17:52 IST 2008
if date > 9 then op: Mon Dec 31 12:17:52 IST 2008
So i want direct op from date commnad means it should contain 2 space bet month and date when date is < 10 and contain 2 space when date is > 9.

Kindly suggest me,

Regards
jaydeep
Reply With Quote
Forum Sponsor
  #2  
Old 01-01-2008
Moderator
 

Join Date: Dec 2003
Location: /dev/fl
Posts: 1,061
Your requirements are unclear. Assuming you want fixed formatting
the following should work:

Code:
 date "+%b %e %l"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0