for d in `cat /tmp/t`; do date +%Y/%m/%d -d $d; done

On Tue, Jul 15, 2008 at 7:34 PM, Abdallah <[EMAIL PROTECTED]> wrote:

>
> Salam Alaikum Wr Wb
>
> I have a brain teaser of the shell utilities type for you guys. :)
>
> A file foo.txt has a list of date strings in this format:
>
> 8/31/2011
> 1/7/2020
> 1/31/2013
> 11/4/2010
>
> and so one.
>
> How would one go about flipping them  into yyyy/mm/dd format in bar.txt?
>
> as in :
>
> 2011/08/31
> 2020/01/07
> 2013/01/31
> 2010/11/04
>
> Notice the single digit month or day must become 2 digits. From 8 to 08
>
>
> "compute regular expressions in his mind at the speed of lighting"  Huh!
>
>
> :D
>
> Wasslam Alaikum wr wb
>
> Abdallah
>
>
> ps.  The speed of light = 299 792 458 m / s   So how many meters do you
> need?
>
> >
>


-- 
abulyomon

www.KiLLTHeUPLiNK.com

--~--~---------~--~----~------------~-------~--~----~
### Jordan Linux Users Group ###
http://Jolug.org/
http://groups.google.com/group/Jolug

### Ubuntu Jordan LoCo Team ###
https://wiki.ubuntu.com/JordanTeam
http://lists.ubuntu.com/ubuntu-jo

### Ojuba Linux ### 
http://ojuba.org/

### Jordan PHP ###
http://groups.google.com/group/JoPHP
-~----------~----~----~----~------~----~------~--~---

رد على