Software » [bash]Concours de script du jour
Catégorie:  
Rappel du message précédent
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:29:04,
Par blietaer
Ah? moi je pensais que vous alliez me sortir un truc à la grep | sed | cut | sort | uniq | wc en deux coups de cuillères...
C'est que je ne me représente pas l'ampleur de la tâche :figti:

mmmh pas vraiment sur une ligne.

Voici un copié-collé...déjà compacté.

PARDON-WARNING ! je voulais dire HTML bien sur et pas XML...



#grep -rni "@" /monrepertoire > out
#cat out
<img src="Info_ContactAngleur-2.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur-2.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/o:2:./En/General/Co_Info-2.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart-2.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart-2.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>
www.spacebel.be/o:3:./En/General/Co_Contact-2.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/o:4:./En/General/Co_Contact-2.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
www.spacebel.be/o:5:./En/General/Co_Jobs-2.html:117: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/o:6:./En/General/Co_Jobs-2.html:168: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/o:7:./en/Space/Sp_Contact.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/o:8:./en/Space/Sp_Contact.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
www.spacebel.be/o:9:./en/Environment/En_Contact.html:92: <img src="../../IcoMouse.gif"> <a href="mailto:info_dvc@spacebel.com"><font color="FFFFFF">info_dvc@spacebel.com</font></a>
www.spacebel.be/o:10:./en/General/Co_Contact.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/o:11:./en/General/Co_Contact.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
www.spacebel.be/o:12:./en/General/Co_Jobs.html:117: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/o:13:./en/General/Co_Jobs.html:168: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/o:14:./en/General/Co_Info.html:73: <img src="Info_ContactAngleur.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/o:15:./en/General/Co_Info.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>
www.spacebel.be/o:16:./fr/Space/Sp_Contact.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/o:17:./fr/Space/Sp_Contact.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
www.spacebel.be/o:18:./fr/space/Sp_Contact-2.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/o:19:./fr/space/Sp_Contact-2.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
www.spacebel.be/o:20:./fr/Environment/En_Contact.html:92: <img src="../../IcoMouse.gif"> <a href="mailto:info_dvc@spacebel.com"><font color="FFFFFF">info_dvc@spacebel.com</font></a>
www.spacebel.be/o:21:./fr/General/Co_Contact.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/o:22:./fr/General/Co_Contact.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
www.spacebel.be/o:23:./fr/General/Co_Jobs.html:115: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/o:24:./fr/General/Co_Jobs.html:164: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/o:25:./fr/General/Co_Info.html:73: <img src="Info_ContactAngleur.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/o:26:./fr/General/Co_Info.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>
Fichier binaire www.spacebel.be/En/General/Tableau Affiliated-2.png concorde
www.spacebel.be/En/General/Co_Info-2.html:73: <img src="Info_ContactAngleur-2.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur-2.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/En/General/Co_Info-2.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart-2.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart-2.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>
Fichier binaire www.spacebel.be/En/General/Tableau Business-2.png concorde
www.spacebel.be/En/General/Co_Contact-2.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/En/General/Co_Contact-2.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
www.spacebel.be/En/General/Co_Jobs-2.html:117: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/En/General/Co_Jobs-2.html:168: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/en/Space/Sp_Contact.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/en/Space/Sp_Contact.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
Fichier binaire www.spacebel.be/en/space/frescodsp_files/DSP_TS_DISTRIB.zip concorde
Fichier binaire www.spacebel.be/en/space/frescodsp_files/ADSP_GCC_SUN_v5_0.tar.gz concorde
Fichier binaire www.spacebel.be/en/space/frescodsp_files/ADSP_GCC_NT_CYG_v50.zip concorde
www.spacebel.be/en/Environment/En_Contact.html:92: <img src="../../IcoMouse.gif"> <a href="mailto:info_dvc@spacebel.com"><font color="FFFFFF">info_dvc@spacebel.com</font></a>
www.spacebel.be/en/General/Co_Contact.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/en/General/Co_Contact.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
Fichier binaire www.spacebel.be/en/General/Tableau Affiliated.png concorde
Fichier binaire www.spacebel.be/en/General/Tableau Business.png concorde
www.spacebel.be/en/General/Co_Jobs.html:117: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/en/General/Co_Jobs.html:168: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/en/General/Co_Info.html:73: <img src="Info_ContactAngleur.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/en/General/Co_Info.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>
www.spacebel.be/fr/Space/Sp_Contact.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/fr/Space/Sp_Contact.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
www.spacebel.be/fr/space/Sp_Contact-2.html:76: <img src="Sp_contact.gif" border=1 usemap="#Map2"><map name="Map2"><area shape="rect" coords="92,188,221,203" href="mailto:luc.halbach@spacebel.be"></map>
www.spacebel.be/fr/space/Sp_Contact-2.html:96: <img src="../../IcoMouse.gif"> <a href="mailto:info_space@spacebel.com"><font color="FFFFFF">info_space@spacebel.com</font></a>
www.spacebel.be/fr/Environment/En_Contact.html:92: <img src="../../IcoMouse.gif"> <a href="mailto:info_dvc@spacebel.com"><font color="FFFFFF">info_dvc@spacebel.com</font></a>
www.spacebel.be/fr/General/Co_Contact.html:100: <img src="../../IcoMouse.gif"> <a href="mailto:info@spacebel.com"><font color="FFFFFF">info@spacebel.com</font></a>
www.spacebel.be/fr/General/Co_Contact.html:112: <img src="Co_Contact.gif" width="273" height="188" usemap="#Map2" border="1"><map name="Map2"><area shape="rect" coords="76,158,235,192" href="mailto:ingrid.leonard@spacebel.be"></map></font></p--->
Fichier binaire www.spacebel.be/fr/General/Tableau Affiliated.png concorde
Fichier binaire www.spacebel.be/fr/General/Tableau Business.png concorde
www.spacebel.be/fr/General/Co_Jobs.html:115: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-be@spacebel.com</font></a>
www.spacebel.be/fr/General/Co_Jobs.html:164: <img src="../../IcoMouse.gif"> <a href="mailto:info_jobs@spacebel.com"><font color="FFFFFF">info_jobs-fr@spacebel.com</font></a></font>
www.spacebel.be/fr/General/Co_Info.html:73: <img src="Info_ContactAngleur.gif" width="388" height="133" border="1" usemap="#Map2Map"><map name="Map2Map"><area shape="rect" coords="0,-2,214,138" href="Co_InfoAngleur.html" alt="How to reach Spacebel Angleur?" title="How to reach Spacebel Angleur?"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"></map>
www.spacebel.be/fr/General/Co_Info.html:75: <p align="center"><font size="2" face="Arial, Helvetica, sans-serif" color="#333399"><a href="#"><img src="Info_ContactHoeilaart.gif" width="388" height="133" border="1" usemap="#Map2"><map name="Map2"><area shape="rect" coords="232,116,372,132" href="mailto:info@spacebel.be" alt="e-mail" title="e-mail"><area shape="rect" coords="1,-2,215,138" href="Co_InfoHoeilaart.html" alt="How to reach Spacebel Hoeilaart?" title="How to reach Spacebel Hoeilaart?"></map></a>


Dernière édition: 02/01/2007 @ 14:30:02
Et au besoin s'arrêter.


   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:32:23,
Par ovh
Ah ben oué grep gère les regexp aussi svrai ça :oh:
Et bon html est un sous-ensemble du xml +/- donc ça va :joce:
Je n'ai rien à voir avec www.ovh.com
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:35:40,
Par blietaer
oui oui grep fait cela, mais grep a un défaut : il renvoit TOUTE la ligne...et en html elle peut être kilométrique, bref on se retrouve quasi avec le fichier de départ.
Et au besoin s'arrêter.
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:55:36,
Par philfr

sed -n '/mailto:[A-Za-z0-9._%-]\+@[A-Za-z0-9.-]\+\.[A-Za-z]\{2,4\}/ s/.*mailto:\([A-Za-z0-9._%-]\+@[A-Za-z0-9.-]\+\.[A-Za-z]\{2,4\}\).*/\1/ p'


Sur ton fichier, ça donne:

info@spacebel.be
info@spacebel.be
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
luc.halbach@spacebel.be
info_space@spacebel.com
info_dvc@spacebel.com
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
info@spacebel.be
info@spacebel.be
luc.halbach@spacebel.be
info_space@spacebel.com
luc.halbach@spacebel.be
info_space@spacebel.com
info_dvc@spacebel.com
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
info@spacebel.be
info@spacebel.be
info@spacebel.be
info@spacebel.be
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
luc.halbach@spacebel.be
info_space@spacebel.com
info_dvc@spacebel.com
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
info@spacebel.be
info@spacebel.be
luc.halbach@spacebel.be
info_space@spacebel.com
luc.halbach@spacebel.be
info_space@spacebel.com
info_dvc@spacebel.com
info@spacebel.com
ingrid.leonard@spacebel.be
info_jobs@spacebel.com
info_jobs@spacebel.com
info@spacebel.be
info@spacebel.be


Si tu pipe ça dans sort puis uniq, il reste

info@spacebel.be
info@spacebel.com
info_dvc@spacebel.com
info_jobs@spacebel.com
info_space@spacebel.com
ingrid.leonard@spacebel.be
luc.halbach@spacebel.be


:oh:
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:57:19,
Par blietaer
MERCIIIIIIIIIIIIIIIIIIIIIIiii !!!!!
Et au besoin s'arrêter.
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:58:28,
Par etik
J'utilise ca, non non je ne spam pas non plus :lol: tu peux rajouter un uniq si necessaire.

tr ',;<>()"\47 ' '[\n*]' | sed -n -e 's/mailto://g' -e '/@/p'
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:59:04,
Par philfr
Ah, quand-même ! :wink:

   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 14:59:51,
Par etik
:fou_crashburn: burned by philfr...
   
[bash]Concours de script du jour
Publié le 02/01/2007 @ 15:10:42,
Par ovh
Un collègue à toi phil ? :petrus:
Je n'ai rien à voir avec www.ovh.com
Répondre - Catégorie:  
Informaticien.be - © 2002-2024 AkretioSPRL  - Generated via Kelare
The Akretio Network: Akretio - Freedelity - KelCommerce - Votre publicité sur informaticien.be ?