![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find user password expiry date | oztoma | UNIX for Dummies Questions & Answers | 4 | 04-17-2009 11:07 AM |
| Digital Certificate Expiry Date | RG18173 | UNIX for Advanced & Expert Users | 1 | 02-06-2009 03:00 AM |
| How to extract date with time from file | prash_b | Shell Programming and Scripting | 5 | 06-18-2008 09:30 AM |
| domain expiry date | learnbash | Shell Programming and Scripting | 6 | 05-22-2008 04:43 AM |
| Extract Date from file | magi | Shell Programming and Scripting | 2 | 09-30-2007 01:07 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extract Expiry date and server_name from the following file
Hi Guys,
I am trying to write one ksh script where I have to go to lots of unix boxes and read one text file which will have data like this though this is not complete data. And I just have to extract expire date ( which is 2nd date value 08/31/2009 in the first one ) and the server name ( astro in first one ) which can be blank sometimes like "" from the text file and put it into local server for record from the all boxes THis is the data loosk like inside that text file # The following line is REQUIRED and must be the first line in license key file. "Yours Trusted" # # SyncSort UNIX 08/31/2004 08/31/2009 "astro" "9000/800" 64 * * * X280-D-1 m1zy x530 4e13 hiej 1mr4 v3kt u833 8282 # # SyncSort UNIX 08/31/2004 08/31/2009 "dhpalh2" "9000/800" 16 * * * X280-A-3 sny5 599a fvvc 4zdc c51y u0s9 fh32 7581 # # SyncSort UNIX 09/15/2003 09/15/2008 "dhpgpl2" "9000/800" 16 * * * V876-U-2 px81 ivvi w8k1 m8hr 92h6 ynt8 um35 4279 # # SyncSort UNIX 08/31/2004 08/31/2009 "dhpmafg1" "9000/800" 64 * * * X280-A-1 b5v9 cswp 9kzk v70s fc8t 9jwi 2835 3730 Any Help plese how to do it I will appreciate the help thank you I have done it and now came up with the following list 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/02/2007 "thfires" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 01/03/2011 "dhttrn2" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/10/2011 "dhpcrpt" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 02/28/2007 "wally" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr1" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/01/2010 "dhqglr2" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpbos1" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpdls2b" 03/14/2011 "dhpglr2b" 03/14/2011 "dhpglr2b" now I have to sort the list in such a way that if expiration date has passed or within seven days from the date runs the script they should come first in the list followed by those between 8th day to 30th and rest whatever will be left and at the last number the list Thank you any help on this I think it should be easier I am trying also lets see what I can do I will appreciate help Last edited by pareshan; 03-16-2009 at 05:51 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|