Gentoo Archives: gentoo-user

From: Ian Zimmerman <itz@×××××××.net>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: -print0 but with 'locate'
Date: Sat, 03 Sep 2016 21:11:16
Message-Id: 20160903205918.8081.35F5F69F@matica.foolinux.mooo.com
In Reply to: [gentoo-user] [OT] -print0 but with 'locate' by Meino.Cramer@gmx.de
1 On 2016-09-03 11:52, Meino.Cramer@×××.de wrote:
2
3 > Is there any trick/option/whatever to get the files with spaced
4 > filenames processed by md5sum in combination with 'locate'?
5
6 In case neither "find -exec +" nor "locate -0" existed (both of which
7 others in this thread have already pointed out), I would do it like this:
8
9 locate foo | awk '{ gsub(/ /,"\\ ",$0); print "md5sum " $0 }' | sh
10
11 Note that this is only one extra process (the awk) over and above the
12 md5sum invocations. I expect the overhead is minimal, and perhaps this
13 is even competitive with the straight "find" solution.
14
15 --
16 Please *no* private Cc: on mailing lists and newsgroups
17 Why does the arrow on Hillary signs point to the right?

Replies

Subject Author
Re: [gentoo-user] Re: -print0 but with 'locate' Joerg Schilling <Joerg.Schilling@××××××××××××××××.de>