🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: leer correctamente l?neas con nombres de archivo con espacios en un shell-script

#12298
From: Antonio Villalon
Date: Wed, 08 Aug 2001 16:40
45 lines
2577 bytes
Carlos F. <carlosfNOSPAM@ucsd.com> wrote:

[...]
: ¿ cómo solucionar esto en un script de shell ? bueno, podría recurrir a 
: Perl y leer las líneas llamar a md5sum con la ruta entera entre comillas y 
: almacenar el resultado en un fichero de salida, que es lo que quiero, pero 
: ¿ es posible en un script ?

Hola
Prueba a utilizar comillas dobles:
	for i in "`find . -type f`"; do md5sum "$i" ;done
O si los tienes ya en una lista, 
	for i in "`cat lista`"; do md5sum "$i";done

A mi me funciona OK:
	$ cat lista
	directorio con espacios/prueba
	$ for i in "`cat lista`"; do md5sum "$i";done
	d41d8cd98f00b204e9800998ecf8427e  directorio con espacios/prueba
	$

Saludos,
			Toni
-- 
#############################################################################
#                      Toni Villalon <toni@aiind.upv.es>                    #
#           TELNET andercheran.aiind.upv.es 2895  for PGP Public Key        #
############################################################################# 
#  "The bad reputation Unix has gotten is totally undeserved, laid on by    #
#   people who don't understand, who have not gotten in there and tried     #
#   anything."                                                              #
#                                              Jim Joyce                    #
############# This .signature is written in 100% recycled bytes #############
Technical Details
Message-ID: <9krq20$s0v$1@polaris.cc.upv.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!news.rediris.es!news.uv.es!news.upv.es!not-for-mail
References: <9krjsg$drq$1@talia.mad.ttd.net>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,2e8fdb5c5b3f8074
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-08-08 09:58:03 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!news.rediris.es!news.uv.es!news.upv.es!not-for-mail
From: Antonio Villalon <toni@andercheran.aiind.upv.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: leer correctamente l?neas con nombres de archivo con espacios en un shell-script
Date: 8 Aug 2001 16:40:32 GMT
Organization: U.P.V.
Lines: 45
Message-ID: <9krq20$s0v$1@polaris.cc.upv.es>
References: <9krjsg$drq$1@talia.mad.ttd.net>
NNTP-Posting-Host: andercheran.aiind.upv.es
Mime-Version: 1.0
Content-Type: text/plain; charset=ES-ASCII
Content-Transfer-Encoding: quoted-printable
X-Trace: polaris.cc.upv.es 997288832 28703 158.42.22.41 (8 Aug 2001 16:40:32 GMT)
X-Complaints-To: newsmaster@upv.es
NNTP-Posting-Date: 8 Aug 2001 16:40:32 GMT
User-Agent: tin/1.4.3-20000502 ("Marian") (UNIX) (Linux/2.2.19 (i586))