bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: findutils-4.2.20-2 - �find: write erro r: Invalid argument�


From: Eric Blake
Subject: Re: Q: findutils-4.2.20-2 - �find: write erro r: Invalid argument�
Date: Thu, 12 Jul 2007 21:50:00 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070604 Thunderbird/2.0.0.4 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to address@hidden on 7/12/2007 2:26 AM:
> Hello,
> 
> I like to get help with an usage problem concerning 
> find | xargs (findutils-4.2.20-2) 
> under windows 2000 command shell.

Consider upgrading your installation.  The latest stable version of
findutils is 4.2.31, and cygwin ships with findutils 4.3.8.  Besides,
4.2.20 has a known security bug.

> 
> The command 
> find ./ -name *.h | xargs -n1 echo
> produces the error message 
> �find: write error: Invalid argument�

Not a bug in find, but a problem in your use (or lack thereof) of shell
quoting.  You meant:

find ./ -name '*.h' | xargs -n1 echo

or more compactly (since . is implied if no directory is given, -print is
implied if no action is given, and xargs defaults to echo, and find
already outputs one file per line) and more secure (in the case of
malicious file names, although -print0 gives even more security for file
systems that support \n in file names):

find -name '*.h'

> The same command line works in the Cygwin bash shell.
> It seems that �find� stuck if the pipe buffer gets full. 

OK, this part of the report is not a findutils question - it is a cmd.com
question, so you should ask on a Windows-related mailing list where
someone can tell you how to work around Microsoft's puny shell limitations
(and if you ask on the cygwin list, the answer will likely be "use the
bash shell if it works and cmd.com doesn't")

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGlvZo84KuGfSFAYARAq8VAJ0RtgydgDytV12H/Ir4bh4dgR9+XgCgr8F4
IeAg5ID39tREasnX6ENToQ0=
=Di8j
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]