Gentoo Archives: gentoo-user

From: covici@××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] xargs and rm funkiness
Date: Sat, 22 May 2010 02:12:18
Message-Id: 16845.1274494309@ccs.covici.com
In Reply to: [gentoo-user] xargs and rm funkiness by Daniel D Jones
1 Daniel D Jones <ddjones@××××××××××××.org> wrote:
2
3 > Running the command:
4 >
5 > find -name *.ext | xargs -0 rm
6 >
7 > I get the result:
8 >
9 > rm: cannot remove `Long File Name One.ext\nLong File Name Two.ext\nLong File
10 > Name Three.ext\n': File name too long.
11 >
12 > (The actual list is much longer than this, of course, or I wouldn't be using
13 > xargs.) For some reason, the \n isn't being recognized as a separator but
14 > rather as a part of a single long file name. Don't think $IFS would affect a
15 > command like rm but it doesn't appear to be the issue:
16 >
17 > ddjones@merlin ~ $ set | grep IFS
18 > IFS=$' \t\n'
19 >
20 > I don't see any other ser variable which looks like a likely candidate to
21 > cause the behavior. Anyone have a clue what's going on?
22 Why do you have -0 -- this replaces the \n's with a null character -- is
23 that what you want?
24
25 --
26 Your life is like a penny. You're going to lose it. The question is:
27 How do
28 you spend it?
29
30 John Covici
31 covici@××××××××××.com

Replies

Subject Author
Re: [gentoo-user] xargs and rm funkiness Daniel D Jones <ddjones@××××××××××××.org>