Fill Manuel wrote: There's no need to reinvent this wheel.
> [EMAIL PROTECTED]:~> dirname ../testfile > .. > [EMAIL PROTECTED]:~> dirname-ng.pl ../testfile > /home > [EMAIL PROTECTED]:~> $ dirname `readlink -m ../testfile` /home > [EMAIL PROTECTED]:~> dirname ../../../././testfile > ../../.././. > [EMAIL PROTECTED]:~> dirname-ng.pl ../../../././testfile > / > [EMAIL PROTECTED]:~> $ dirname `readlink -m ../../../././testfile` / > [EMAIL PROTECTED]:~> dirname ../testfile /tmp/testfile2 > dirname: too many arguments > Try `dirname --help' for more information. > [EMAIL PROTECTED]:~> dirname-ng.pl ../testfile /tmp/testfile2 > /home > /tmp > [EMAIL PROTECTED]:~> $ for F in ../testfile /tmp/testfile2; do dirname `readlink -m $F`; done /home /tmp We already did this thread just a few weeks ago. <http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00019.html> > [EMAIL PROTECTED]:~> find /tmp/test/* | dirname | sort | uniq > dirname: too few arguments > Try `dirname --help' for more information. > [EMAIL PROTECTED]:~> find /tmp/test/* | dirname-ng.pl - | sort | uniq > /tmp/test > /tmp/test/a > /tmp/test/b > /tmp/test/c > /tmp/test/d Now why in the world would you go to all that trouble? You're listing every single file and directory in the tree, only to then go and strip the filename component entirely, resulting in massive duplication that you then have to remove. What's wrong with just telling find to list directories: find /tmp/test -type d Brian _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
