Gentoo Archives: gentoo-user

From: Kai Krakow <hurikhan77@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: [OT] -print0 but with 'locate'
Date: Sat, 03 Sep 2016 14:45:42
Message-Id: 20160903164518.01e7a76f@jupiter.sol.kaishome.de
In Reply to: [gentoo-user] [OT] -print0 but with 'locate' by Meino.Cramer@gmx.de
1 Am Sat, 3 Sep 2016 11:52:46 +0200
2 schrieb Meino.Cramer@×××.de:
3
4 > Hi,
5 >
6 > I want to 'locate' a bunch of files and feed the output into
7 > '| xargs md5sum'.
8 > Unfortunately some of them are infected with the "file name"-virus
9 > (space in the filename).
10 > With find there is the -print0 option which corresponds to '-0' of
11 > the xargs options. As of my knowledge, locate does not have such
12 > a thing.
13 > I dont like the idea to 'find' (read: 'search again')all the files,
14 > which locate already knows...so
15 > Is there any trick/option/whatever to get the files with spaced
16 > filenames processed by md5sum in combination with 'locate'?
17
18 In that case try
19
20 $ locate ... | while read name; do md5sum "$name"; done
21
22 This works for results having one filename per line.
23
24 --
25 Regards,
26 Kai
27
28 Replies to list-only preferred.