![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to extract date with time from file | prash_b | Shell Programming and Scripting | 5 | 06-18-2008 05:30 AM |
| Script to Extract time from log files and write to a excel | santosham | Shell Programming and Scripting | 0 | 06-06-2008 10:28 AM |
| Script to Extract time from log files and write to a excel | santosham | UNIX for Advanced & Expert Users | 0 | 06-06-2008 10:27 AM |
| extract last modified time of file in form of YYYYMMDD | itsme_maverick | Shell Programming and Scripting | 3 | 05-28-2008 09:01 AM |
| How to extract two words at the same time. | Aejaz | UNIX for Advanced & Expert Users | 6 | 04-30-2008 06:09 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Extract TIME
Hey guys.
How would I go about extracting the time from the system clock and inserting it into a variable? Any thoughts? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Look at the date command. The different formats will allow you to save that value in a variety of ways.
|
|
#3
|
|||
|
|||
|
I think I got it,
ts=`date +%H%M` Thanks again. |
|
#4
|
|||
|
|||
|
I was givin the task to, Glean the time only and write a small script that echo’s before or after the time you specify.
Would this work: ts=`date +%H%M` echo ts if ts > 0900 echo after else echo before fi |
|
#5
|
||||
|
||||
|
Is this homework? If it is, its against the rules.
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|