.\" @(#)basename.1 6.2 (Berkeley) %G%
basename, dirname \- strip filename affixes
\fBbasename\fP \fBstring\fP [ \fBsuffix\fP ]
\fBdirname\fP \fBstring\fP
\fIBasename\fP deletes any prefix ending in `/' and the \fIsuffix\fP,
if present in \fIstring\fP, from \fIstring\fP, and prints the result
to the standard output. It is normally used inside substitution marks
(\`\`) in shell procedures.
\fIDirname\fP deletes from the last slash (``/'') to the end of
\fIstring\fP, and prints to result to the standard output.
This shell procedure invoked with the argument \fI/usr/src/bin/cat.c\fP
compiles the named file and moves the output to \fIcat\fP in the current
mv a.out \`basename $1 .c\`
The following line sets the shell variable \fIFOO\fP to \fI/usr/bin\fP.
FOO=`dirname /usr/bin/trail`