![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Your requirements are unclear. Assuming you want fixed formatting
the following should work: Code:
date "+%b %e %l" |
|||
| Google The UNIX and Linux Forums |