1 2 3 4
# inspired by an autoconf generated configure script. s%/[^/][^/]*$%% s%[\/][^\/][^\/]*$%% s,.*[^\/],,