Article View: es.comp.os.linux.programacion
Article #10534Re: [OT] una pregunta de examen
From: J.A. Gutierrez
Date: Thu, 21 Feb 2002 09:50
Date: Thu, 21 Feb 2002 09:50
40 lines
1985 bytes
1985 bytes
Rafael Moreno Jimenez <laocanfei@yahoo.com> wrote: : Lo siento, no he podido resistirme : for linea in $(cat fich1.dat); do mal: uso innecesario de cat : clave=$(echo $linea|cut -f1 -d:) uso inecesario de subshell, de echo, y de cut : profesion=$(grep $clave fich2.dat|cut -f1 -d:) : echo "$linea::$profesion" >>RESULTADO.DAT : done no, no si lo quieres hacer con algo de ese estilo seria mejor #!/bin/sh IFS=algo while read id nombre apellido do egrep ":id$" fich2.dat | read curro id2 echo "$id:$nombre:$apellido:$curro" done < fich1.dat # nota: programa deliberadamente estropeado para que haya que # currarselo minimamente -- PGP and other useless info at \ http://www.cps.unizar.es/~spd/ \ finger://daphne.cps.unizar.es/spd \ Timeo Danaos et dona ferentes ftp://ivo.cps.unizar.es/pub/ \ (Virgilio)
Technical Details
Message-ID:
<a52ft4$p9d$1@news.unizar.es>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!dca6-feed2.news.digex.net!intermedia!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!news.unizar.es!not-for-mailReferences:
<a4vth7$4qf$1@news.ua.es> <74eb6167.0202200553.51a7f4b3@posting.google.com>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit
X-Google-Thread: f86c8,cf1b769eafe4ae69
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-02-21 01:28:07 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!dca6-feed2.news.digex.net!intermedia!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!news.unizar.es!not-for-mail
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: [OT] una pregunta de examen
Date: 21 Feb 2002 09:50:28 GMT
Organization: Rank
Lines: 40
Message-ID: <a52ft4$p9d$1@news.unizar.es>
References: <a4vth7$4qf$1@news.ua.es> <74eb6167.0202200553.51a7f4b3@posting.google.com>
NNTP-Posting-Host: daphne.cps.unizar.es
X-Trace: news.unizar.es 1014285028 25901 155.210.152.20 (21 Feb 2002 09:50:28 GMT)
X-Complaints-To: usenet@news.unizar.es
NNTP-Posting-Date: 21 Feb 2002 09:50:28 GMT
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (IRIX/6.2 (IP22))