Article View: es.comp.os.linux.programacion
Article #7753Re: duda con script de bash
From: catactttc
Date: Tue, 28 Jan 2003 16:48
Date: Tue, 28 Jan 2003 16:48
27 lines
2091 bytes
2091 bytes
In article <b16bca$t0u7k$1@ID-158006.news.dfncis.de>, Esteban Navarro wrote: > David dijo: > >>> # m�s cosas del script >>> >> Y si suponemos que el fichero "entrada.txt" tiene lo siguiente: >> pepe:123adee111 >> ana:2wdueu222 >> manolo:238982js > >> �Tambien me servira para borrar la linea entera? >> Es decir, que yo le paso el nombre del usuario (pepe, ana, etc) a borrar y >> me elimina toda la linea. > > Tambi�n si no quieres borrar toda la linea puedes usar cut: > > grep -v pepe fichero | cut -c 6-14 > fichero2 > Me parece que te equivocas, 'grep -v string' hace que se muestren TODAS las l�neas __MENOS__ las que contengan la cadena "string"; el cut en este caso har� que se corten las dem�s lineas. Para hacer eso, no borrar toda la l�nea, simplemente hay que usar sed o awk Un saludo.
Technical Details
Message-ID:
<b16c8m$lp$1@peque.uv.es>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!news.telia-iberia.com!bashful.rediris.es!news.uv.es!not-for-mailReferences:
<3E32BC97.BE023DEF@menta.net> <slrnb36b0t.hg.arbeizaf@jupiter.olimpo> <slrnb3appd.bch.marmolejo@porta.til> <3E36949B.8F1ECC6C@menta.net> <b16bca$t0u7k$1@ID-158006.news.dfncis.de>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,8fbbda953043e037 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2003-01-28 08:58:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!news.telia-iberia.com!bashful.rediris.es!news.uv.es!not-for-mail From: catactttc <catactttc@nospam.aqui.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: duda con script de bash Date: Tue, 28 Jan 2003 16:48:22 +0000 (UTC) Organization: Universitat de Valencia Lines: 28 Distribution: es Message-ID: <b16c8m$lp$1@peque.uv.es> References: <3E32BC97.BE023DEF@menta.net> <slrnb36b0t.hg.arbeizaf@jupiter.olimpo> <slrnb3appd.bch.marmolejo@porta.til> <3E36949B.8F1ECC6C@menta.net> <b16bca$t0u7k$1@ID-158006.news.dfncis.de> NNTP-Posting-Host: 213-99-157-213.uc.nombres.ttd.es Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: peque.uv.es 1043772502 697 213.99.157.213 (28 Jan 2003 16:48:22 GMT) X-Complaints-To: newsmanager@uv.es NNTP-Posting-Date: Tue, 28 Jan 2003 16:48:22 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux)