> > On a related note, why don't rm and rmdir have a --strip-trailing-slashes > > option? > > Because as far as I know, there is no need. > Do you know of a system where `rmdir symlink/' > removes only the referent of the symlink?
By a strict reading of http://www.opengroup.org/onlinepubs/009695399/utilities/rm.html, 'rm -R symlink/' should empty the referrant, then fail! step 0: the command line does not end in . step 1: symlink/ exists step 2: 'symlink/' is of type directory ('symlink', on the other hand, is of type symlink); this is the recursion, ending with the referrant being emptied, and symlink and symlink/ still existing step 3: 'symlink/' is a directory step 4: call rmdir("symlink/"), which should fail with EINVAL But no implementation of rm(1) that I am aware of does this; they all unlink symlink and call it quits, leaving the referrant (and its contents) alone. We really do need to clean this up with the austin group; surely they intended to document historical behavior. -- Eric Blake _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
