Hi Ryan:

I believe I have some link at the office. I will try and remember
to forward them to you on Monday.

In the interim, take a look at the awk command. This will allow
you to reformat the input lines (as well as many other things).
For a start the command:

    awk '{print $10 " " $7 " " $8 " " $9}' <infile

(where infile is you input file name) will reformat your line to:

2003 Feb 3 00:32:48

You can then pipe the output to sort to sort the lines.

Perl would probably be better but I don't know it well enough to
give you an example. Anyway, that should give you a push in the
right direction.

There is a newsgroup, comp.unix.shell, that might be a better
place to post shell programming questions.

HTH

Regards, Hugh

--
Hugh E Cruickshank, Forward Software, www.forward-software.com

From: RD Egeland Sent: Saturday, February 01, 2003 16:51
>
> I'm just learning how to write shell scripts, and I'd like to
> find example
> scripts to look at.  The BASH howto and Advanced BASH howto isn't
> too great
> in this respect.
>
> The immediate task I'm trying to do is extract a date into a standardized
> format which I can then somehow sort.  The text I need to extract
> the date
> from looks like:
>
> Bid End time (eBay)       : Mon Feb  3 00:32:48 2003 (GMT)
>
> Any tips?
>
> Ryan
>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to