Article View: es.comp.os.linux.programacion
Article #13285Re: Sustituir una sola vez con sed (o perl)
From: Han Solo
Date: Thu, 08 Mar 2001 00:45
Date: Thu, 08 Mar 2001 00:45
54 lines
2889 bytes
2889 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
pere@hola.fou.net (Pere Pujal Carabantes) writes:
> >Por cierto, la p�gina man de sed sux :-)
>
> Las he visto mejores pero...
>
> Addresses
> Sed commands can be given with no addresses, in which case
> the command will be executed for all input lines; with one
> address, in which case the command will only be executed
> for input lines which match that address; or with two
> addresses, in which case the command will be executed for
> all input lines which match the inclusive range of lines
> starting from the first address and continuing to the sec�
> ond address. Three things to note about address ranges:
> the syntax is addr1,addr2 (i.e., the addresses are sepa�
> rated by a comma);
Me lo se para la pr�xima... Miento, no piendo usar sed jam�s.
> Prueba con esto en un fichero
>
> 1,3{
> s/cadena a substituir/cadena nueva/
> }
No funciona, porque esto supone (si no he entendido mal el manual) que
lo que busco tiene que estar entre la primera y tercera l�nea, y eso
no lo puedo saber a priori. De hecho, en el fichero con el que hac�a
las pruebas, estaba mucho m�s abajo.
- --
Un Saludo
Han Solo
The Rebel Alliance
Emacs is not on every system
So what? [...] Do you tell your administrative people to stick with
notepad.exe? Do you tell your fat kids they can only have the crummy
games that come with their video games or plain dress that comes with
Barbie?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.5 and Gnu Privacy Guard <http://www.gnupg.org/>
iEYEARECAAYFAjqm1iIACgkQ4FjpJaPEp22ECACg6GoOhY1b3Eem+1CIuZTBOs9o
IgkAn2eW16bI08bR2o3tiKaV8u9SOKSz
=sOcx
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<87ofvd6qcb.fsf@alderaan.maptel.es>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!fu-berlin.de!uni-berlin.de!212-7-51-145.wolbiz.worldonline.ES!not-for-mailReferences:
<8766hn6jpk.fsf@alderaan.maptel.es> <slrn9aah86.ta.pere@hola.fou.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,57bf867c8699b7fc X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-03-07 19:04:09 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!fu-berlin.de!uni-berlin.de!212-7-51-145.wolbiz.worldonline.ES!not-for-mail From: Han Solo <hsolo@escomposlinux.org> Newsgroups: es.comp.os.linux.programacion Subject: Re: Sustituir una sola vez con sed (o perl) Date: 08 Mar 2001 01:45:24 +0100 Organization: The Rebel Alliance Lines: 54 Message-ID: <87ofvd6qcb.fsf@alderaan.maptel.es> References: <8766hn6jpk.fsf@alderaan.maptel.es> <slrn9aah86.ta.pere@hola.fou.net> NNTP-Posting-Host: 212-7-51-145.wolbiz.worldonline.es (212.7.51.145) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 984020481 663707 212.7.51.145 (16 [63837]) X-Server-Date: 8 Mar 2001 00:45:24 GMT User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7