dirname and basename errors
From: Remi Villatel (maxilys_at_SPAMCOP.tele2.fr)
Date: Thu, 01 Apr 2004 02:10:00 +0200
I encountered a strange behavior of dirname and basename:
% dirname aaa/bbb/ccc/
% basename aaa/bbb/ccc/
Both are wrong answers! dirname should return "aaa/bbb/ccc/" unchanged and
basename shoud return an empty string IMHO.
How can I obtain correct answers from them with a pathname without a real
filename as in my example?
I introduced a test to check if the last char of the pathname is "/" but
isn't there anything more simple?