[-?
@(#)$Id: dirname (AT&T Research) 2009-01-31 $
]
[+NAME?dirname - return directory portion of file name]
[+DESCRIPTION?\bdirname\b treats \astring\a as a file name and returns the name of the directory containing the file name by deleting the last component from \astring\a.]
[+?If \astring\a consists solely of \b/\b characters the output will be a single \b/\b. Trailing \b/\b characters are removed, and if there are no remaining \b/\b characters in \astring\a, the string \b.\b will be written to standard output.  Otherwise, all characters following the last \b/\b are removed. If the remaining string consists solely of \b/\b characters, the output will be as if the original string had consisted solely as \b/\b characters as described above.  Otherwise, all trailing slashes are removed and the output will be this string unless this string is empty.  If empty the output will be \b.\b.]
[f:file?Print the \b$PATH\b relative regular file path for \astring\a.]
[r:relative?Print the \b$PATH\b relative readable file path for \astring\a.]
[x:executable?Print the \b$PATH\b relative executable file path for \astring\a.]

string

[+EXIT STATUS?]{
[+0?Successful Completion.]
[+>0?An error occurred.]
}
[+SEE ALSO?\bbasename\b(1), \bgetconf\b(1), \bdirname\b(3), \bpathname\b(3)]
