🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #350

Re: Problemas con sed

#350
From: Ignacio Arenaza
Date: Sat, 03 Jan 2009 16:30
35 lines
2610 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jes�s Carrete Monta�a <kuantiko@escomposlinux.org> writes:

> Perd�n, se me olvid� comprobar que la URL empiece por http antes de borrarla:
>
> sed -n  ':repetir;h;s/.*<a href="\(http[^"]*\)".*$/\1/p;g;s/\(.*\)<a href="http[^"]*".*$/\1/;t repetir' < html.html

Peque�o detalle adicional: las URLs de un href no tienen porque ser
del tipo http:/..., puede ser URLs relativas. Es decir, habr�a que
quitar las referencias a 'http' de los patrones de busqueda.

sed -n  ':repetir;h;s/.*<a href="\([^"]*\)".*$/\1/p;g;s/\(.*\)<a href="[^"]*".*$/\1/;t repetir' < html.html

Si ademas puede haber espacios en blando antes y depues de los '=' y
las '"' (que lo puede haber), la cosa se puede complicar un pel�n m�s.

Por cierto Kuantiko, ���cuantos a�os sin leerte!!! Supongo que ya no
tendr�s la pinta de la foto de la p�gina de habituales de ecol :-)

Saludos. I�aki.

- -- 
Mondragon University

GPG Key available at public keyservers
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt and GPG

iD8DBQFJX5KlRgC43oKhB3QRAoofAKCjK5GWJ28MmOh3rziPGmb+SD53JQCgsRqu
I3ZkuGzczC4zM5T/WDd/ieA=
=9o1i
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <67tz8ggxna.fsf@poseidon.eteo.mondragon.edu>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!fu-berlin.de!news.eteo.mondragon.edu!eteo.mondragon.edu!not-for-mail
References: <195b7bbf-d5b3-43a9-9d01-996fc03a3726@o4g2000pra.googlegroups.com> <6763kyimbc.fsf@poseidon.eteo.mondragon.edu> <671vvmim8m.fsf@poseidon.eteo.mondragon.edu> <d6e487bd-2646-4715-811a-6fec3da796f3@n33g2000pri.googlegroups.com> <gjl88d$473$1@cagarruta.escomposlinux.org> <gjl8c9$473$2@cagarruta.escomposlinux.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,3f9e8ae1c57984bc
X-Google-Attributes: gidf86c8,domainid0,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!fu-berlin.de!news.eteo.mondragon.edu!eteo.mondragon.edu!not-for-mail
From: Ignacio Arenaza <iarenaza@eb2ebu.ampr.org>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Problemas con sed
Date: Sat, 03 Jan 2009 17:30:33 +0100
Organization: Mondragon Unibertsitatea - ETEO
Lines: 35
Distribution: es
Message-ID: <67tz8ggxna.fsf@poseidon.eteo.mondragon.edu>
References: <195b7bbf-d5b3-43a9-9d01-996fc03a3726@o4g2000pra.googlegroups.com> <6763kyimbc.fsf@poseidon.eteo.mondragon.edu>
 <671vvmim8m.fsf@poseidon.eteo.mondragon.edu>
 <d6e487bd-2646-4715-811a-6fec3da796f3@n33g2000pri.googlegroups.com>
 <gjl88d$473$1@cagarruta.escomposlinux.org>
 <gjl8c9$473$2@cagarruta.escomposlinux.org>
NNTP-Posting-Host: sid.eteo.mondragon.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: poseidon.eteo.mondragon.edu 1231000233 30798 172.31.3.9 (3 Jan 2009 16:30:33 GMT)
X-Complaints-To: newsmaster@eteo.mondragon.edu
NNTP-Posting-Date: Sat, 3 Jan 2009 16:30:33 +0000 (UTC)
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:Jsj9bavKTDCHv4iG9vltEeAvzmk=