greycat 1282309533 learn dirname(1) removes the filename part of a pathname (/a/b/c -> /a/b). Or you can use a parameter expansion: "${path%/*}" lhunath 1331328859 forget lhunath 1331328877 learn dirname(1) removes the filename part of a pathname (/a/b/c -> /a/b). A parameter expansion can do it cleaner and *much* faster: "${path%/*}" Stummi 1461067789 forget Stummi 1461068909 learn dirname(1) removes the filename part of a pathname (/a/b/c -> /a/b). A parameter expansion can do it cleaner and *much* faster: "${path%/*}". Beware the difference for arguments without /