-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Andreas Schwab on 2/19/2008 2:32 PM: |> Under the influence of -L, does -xtype l work like -lname '*' in |> detecting just the broken symlinks? | | You don't use -L of course (it isn't supported by find 4.1 anyway). | Note that with -L you would risk walking out of the base directory.
POSIX requires "find -L . -type l" to print all broken symlinks, but has the drawback, as you mention, of following symlinks into other directories, as well as the drawback that not all finds are POSIX-compliant (Solaris 8 find, for example, does not understand -L). POSIX also requires "-exec ... {} +" to work, but not all finds support that (and since you seem to be stuck on the ancient GNU find 4.1, that is one of the programs that lacks it). Without "-exec ... {} +", you run the risk of a poorly named symlink containing metacharacters which won't work nicely with xargs, or you suffer a slowdown of "-exec ... {} \;", or you fall back to extensions like -print0. Everything else mentioned in this thread (-xtype, -delete, -lname, - -print0) is a GNU extension; and while BSD find has some of the same extensions, it does not have them all. And Solaris find is just too poor in features to find broken symlinks in the first place. So once you assume GNU find, you might as well assume it in multiple aspects. I'll leave it up to Jim what to put in the bootstrap script. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----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 iD8DBQFHvCbx84KuGfSFAYARAigvAKCkulOxSPFyEJp0x7wkbZ7J46Sp1wCgw5iM OqVvY2xjZHa8sO1C6QyShcQ= =w1zo -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils