🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: sustituir caracteres

#238
From: Ignacio Arenaza
Date: Mon, 22 Feb 2010 21:32
41 lines
2407 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

jose maria <letrados@usernix.org> writes:

> * Y debo de producir un resultado final como este y aplicarle un comando a 
> cada linea.
>
> "/media/cluster1/ftp01/CBR101031/copia server enjul/copia server"
> "/media/cluster1/ftp03/CBR101321/eb/Datos7 19.02.2010 
> 07.12/log_20091005_2250.txt"

Una de tantas formas, suponiendo que las comillas dobles de inicio y
fin que has escrito no formen parte de las l�neas en s� (se muestra en
varias lineas, pero deber�a ir en una sola):

awk -F'|' '{ print "/media/cluster1/" $2 "/" $3 "/" $4 "/" $5 "/" $6}'
   fichero | while read i; do orden -parametros "$i"; done;

Si las lineas realmente contienen los caracters '"' al comienzo y al
final, algo como esto deber�a funcionar:

awk -F'|' '{ print "/media/cluster1/" $2 "/" $3 "/" $4 "/" $5 "/"
    substr($6,1,length($6)-1)}' fichero | while read i; do orden
       -parametros "$i"; done;  

Saludos,
I�aki.

- -- 
Mondragon University

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

iD8DBQFLgvgHRgC43oKhB3QRAnGiAKDffvpsbvS/LG+DYYQJQ6q9e4YkbwCePF9F
4uyCrLWQt/hamk3DFct6sHs=
=Nr8O
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <67mxz1552u.fsf@poseidon.eteo.mondragon.edu>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!bolzen.all.de!fu-berlin.de!news.eteo.mondragon.edu!eteo.mondragon.edu!not-for-mail
References: <hluo6u$e3j$1@speranza.aioe.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: 646d03421f,7f533009afd47089
X-Google-Attributes: gid646d03421f,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!bolzen.all.de!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: sustituir caracteres
Date: Mon, 22 Feb 2010 22:32:57 +0100
Organization: Mondragon Unibertsitatea - ETEO
Lines: 41
Distribution: es
Message-ID: <67mxz1552u.fsf@poseidon.eteo.mondragon.edu>
References: <hluo6u$e3j$1@speranza.aioe.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 1266874377 3379 172.31.3.9 (22 Feb 2010 21:32:57 GMT)
X-Complaints-To: newsmaster@eteo.mondragon.edu
NNTP-Posting-Date: Mon, 22 Feb 2010 21:32:57 +0000 (UTC)
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:+6ijBqlv/aas1WBovwJFbNozDDs=