-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Ladislav Hagara on 11/30/2009 4:46 PM: > New 8.1 rm prints another message "invalid argument" and DOESN'T remove > files: > > # rm --version | head -n 1 > rm (GNU coreutils) 8.1 > # touch a b c; rm a b "" c; ls > rm: invalid argument: `' > a b c > Is this a bug or a new feature of rm 8.1?
Thanks for the report. This is indeed a regression and a violation of POSIX, and was probably caused by our move from a hand-rolled recursion over to using an enhanced fts interface (hence I'm guessing it popped up in coreutils 8.0). It will be fixed before the next release. > Should all scripts be rewritten (test if file really exist and then > remove it) or new rm 8.2 will again remove files? It depends on how worried you are about the likelihood of distros distributing unpatched coreutils 8.0 and 8.1 builds, and how worried you are about encountering it in the wild. In general, passing an empty file name to rm is never going to succeed, so there's already room for improvement in your scripts; so this could be the justification to make those changes. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksUcZoACgkQ84KuGfSFAYCC7wCeJeU8LknVE8btEKWguOyc20K9 V2YAnRNZwGqyG1yWAziRHOOn4aAd7DBD =BUaH -----END PGP SIGNATURE-----