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?
Salam Alaikum Abulyomon.
You just earned a mansaf dinner prize on me anywhere you like. :)
How are you doing? Where in the world are you?
Abdallah
Years beyond 2036 are giving
date: invalid date `8/31/2088'
date: invalid date `4/30/2046'
Abdallah
On Tue, Jul 15, 2008 at 12:51 PM, Yaman Saqqa <abul...@gmail.com> wrote:
I got around the 2038 date limit but running the command on a 64bit system.
However, I can not get the results out. It is a telnet account to a
test HP server.
Ok. So I need someone with access to a 64bit box. I need access for
5 minutes. Or you could run the command on 2 files for me and send me
the results.
Please contact me off list if you are able to do this for me.
:)
Wassalam Alaikum wr wb
Abdalla
By the way, if anyone would like to have access to HP high end servers
then sign up for a shell access account here:
http://www.testdrive.hp.com/accounts/register.shtml
Here are the systems they gave me access to:
Hewlett Packard OS Test Drives:
Test Drive System Type
How to access
HP OpenVMS 8.3 Integrity rx2600 2...@1.4GHz
telnet to td183.testdrive.hp.com
HP OpenVMS 8.3 Integrity rx2600 2...@1.4GHz
telnet to td184.testdrive.hp.com
HP-UX 11i 11.11 rp2470 2@750MHz 8700 PA-RISC
telnet to td192.testdrive.hp.com
HP-UX 11i v2 Integrity rx2600 2...@1.4GHz
telnet to td176.testdrive.hp.com
HP-UX 11i v3 PA-RISC rp3410 telnet to td191.testdrive.hp.com
HP-UX 11i v3 Integrity bl860c 2...@1.6GHz
telnet to td194.testdrive.hp.com
HP-UX 11i v3 Integrity rx3600 2...@1.4GHz telnet to td193.testdrive.hp.com
Linux Test Drives:
Test Drive System Type
How to access
Debian GNU/Linux 4.0r0 on Intel ProLiant DL140 2...@3.2GHz(Xeon)
telnet to td140.testdrive.hp.com
Debian GNU/Linux 4.0r0 on Intel Integrity rx2600 2@900MHz
telnet to td156.testdrive.hp.com
Debian GNU/Linux 4.0r0 on AMD ProLiant DL385 2.6GHz(Opteron)
telnet to td157.testdrive.hp.com
Mandriva Corporate Server 4.0 ProLiant DL380 2p/4c 3.6GHz
telnet to td153.testdrive.hp.com
Oracle Enterprise Linux 4 ProLiant DL145 2...@2.2GHz telnet to
td189.testdrive.hp.com
Red Hat Ent Linux 5 on Intel ProLiant bl460c 4...@3.0GHz(Xeon)
telnet to td163.testdrive.hp.com
Red Hat Ent Linux 5 on AMD ProLiant bl465c 4...@1.0GHz(Opt)
telnet to td165.testdrive.hp.com
Red Hat Ent Linux 5 on Intel ProLiant DL380 4p/8c 2.4GHz telnet
to td161.testdrive.hp.com
Red Hat Ent Linux 5 on Intel ProLiant DL560 4...@3.0GHz(Xeon)
telnet to td185.testdrive.hp.com
Red Hat Ent Linux 5 on Intel Integrity rx3600 2...@1.4GHz
telnet to td188.testdrive.hp.com
Red Hat Ent Linux 5 on Intel Integrity rx8620 1...@1.5GHz
telnet to td178.testdrive.hp.com
Red Hat Ent Linux 5 on AMD ProLiant DL145 2.4GHz(Opteron)
telnet to td159.testdrive.hp.com
SuSE Linux Ent Svr 10 on Intel ProLiant bl460c 2...@3.0GHz(Xeon)
telnet to td165.testdrive.hp.com
SuSE Linux Ent Svr 10 on AMD ProLiant bl465c 2...@1.0GHz(Opt)
telnet to td166.testdrive.hp.com
SuSE Linux Ent Svr 10 on Intel ProLiant DL140 2...@3.2GHz(Xeon)
telnet to td186.testdrive.hp.com
SuSE Linux Ent Svr 10 on AMD ProLiant DL145 2.2GHz(Opteron)
telnet to td190.testdrive.hp.com
SuSE Linux Ent Svr 10 on AMD ProLiant DL585 2.2GHz(Opteron)
telnet to td179.testdrive.hp.com
SuSE Linux Ent Svr 10 on Intel Integrity rx2600 2@1.4 GHz
telnet to td187.testdrive.hp.com
BSD Test Drives:
Test Drive System Type
How to access
FreeBSD 6.2 on Intel Integrity rx2600 2...@1.4GHz
telnet to td150.testdrive.hp.com
FreeBSD 6.2 on Intel ProLiant DL360 2...@1.4GHz (P3)
telnet to td152.testdrive.hp.com
Windows TestDrives:
Test Drive System Type
How to access
Microsoft Ent Svr 2003 on Intel Integrity rx2600 2...@1.4GHz rdp
to td197.testdrive.hp.com
Microsoft Ent Svr 2003 on AMD ProLiant DL145 2...@2.4GHz rdp
to td198.testdrive.hp.com
MicroSoft Ent Svr 2003 on Intel ProLiant DL140 2...@3.2GHz rdp
to td199.testdrive.hp.com
Application Test Drives:
Test Drive System Type
How to access
Oracle Rbd on OpenVMS Integrity rx1620 2@1GHz
telnet to td183.testdrive.hp.com
foo.txt
8/31/2011
1/7/2088
1/31/2013
11/4/201
gives:
2011/08/31
date: invalid date `1/7/2088'
2013/01/31
2010/11/04
I got to have a 64 bit system. :D
Thanx for the input.
Abdallah
--8/31/2011
--1/7/2088
--1/31/2013
--11/4/2010
Must be:
2011/08/31
2088/01/07
2013/01/31
2010/11/04
:)
Abdallah
jad@syntux:~/fi/makan/ma$ head foo.txt
4/30/2010
3/17/2012
8/31/2009
6/30/2012
7/31/2010
8/31/2011
1/26/2020
1/31/2013
11/17/2010
10/31/2012
jad@syntux:~/fi/makan/ma$ head foo.txt | awk -F'/' '{OFS="/"; print
$3,$1,$2}' | sed s'/\/\([[:digit:]]\)\//\/0\1\//g' | sed
s'/\/\([[:digit:]]\)$/\/0\1/g'
/04/30
/03/17
/08/31
/06/30
/07/31
/08/31
/01/26
/01/31
/11/17
/10/31
more foo.txt | awk -F'/' '{OFS="/"; print $3,$1,$2}' | sed
s'/\/\([[:digit:]]\)\//\/0\1\//g' | sed s'/\/\([[:digit:]]\)$/\/0\1/g'
2011/08/31
2088/01/07
2013/01/31
2010/11/04
cat foot.txt | awk -F'/' '{printf "%.4d/%.2d/%.2d\n",$3,$1,$2}'
I guess this got the job done. I haven't tried to php ones. Sorry.
But although I agree that sed and awk should rule the world, I would
love to see a web site made with them anytime soon. .
Thank you all for your contributions.
Mansaf for all on this thread insha'Allah soon. We just need an
excuse to meet. Don't we? :D
Abdallah
my first $(stupid) solution solved it although it takes TOOOOO much
time and processing power LoL
sed/for/mysql/awk/sed again/sed again
LoL
el extra mansaf seat eli ana
But for me to be there it will have to wait some time. I am outside
Jordan for few weeks. :(
You go ahead if you like next Sat. My invitation stands till I am
back so I can go with you guys. Unless you want to involve Eastern
Union?
Abdallah
P.S: Are we going to get those PHP "solutionist" with us ? :p
Mansaf without you Abdallah worth nothing, Next Saturday
P.S: Are we going to get those PHP "solutionist" with us ? :p
Absolutely. :D Al Faisal will be the only one on time that day. For
that alone he gets an extra order.
@Khamis: Yes. my invitation stands. Insha'Allah, once I am back in
beloved Jordan it will be the first thing I am gana do. Sigh.. I
miss mansaf. :(
oops. I miss you guys.
El 3alam 7a takul ba3d ya Abu 7hmaid.
:D
Abdallah
Haha
Although I do not like mansaf, but I’ll assist with any info about the whereabouts of Mr. Abdullah.
J
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.6.1/1605 - Release Date: 8/11/2008 4:59
PM
2008/8/12 Fadi Kahhaleh <fa...@kahhaleh.org>:
the guy is multiverse!
2008/8/13 Khamis Siksek <khamis...@gmail.com>:
On Tue, Aug 19, 2008 at 10:21 PM, Jad madi <con...@jadmadi.net> wrote:
> Waaaaaaaaaaaaaaaalllllllllllll
>
--
### 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
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
### 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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.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
---
You received this message because you are subscribed to the Google Groups "Jolug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jolug+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/33182607-e2ce-4c73-b32c-a1e1310d4df8n%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/CABUrHo8BKyiCHG3eb0g8EN0m6uggagGta3a-JPAGy3CyH%2BMcOQ%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/CAPasUsJ_JpRPpgwNsSHgxoN3%2BL86%2BkMh600ZKyKjEvqFF_bU_Q%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/CAGN%3Drc%3D4h60OP1oqF_%2BMgrBPf0pVBdyLQJ%3Dc7Auq84aJnPiQXg%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/CAPasUsJ_JpRPpgwNsSHgxoN3%2BL86%2BkMh600ZKyKjEvqFF_bU_Q%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/CAKY8vRt%2BnSbF4W-iAxwFtsn0Ts7xMoHoRuckbFP9AEFNhZF_tQ%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jolug/d1970726-0049-493d-8af9-5926791f73b2n%40googlegroups.com.