4.2BSD/usr/man/man1/basename.1

Compare this file to the similar file:
Show the results in this format:

.TH BASENAME 1 "1 April 1981"
.SH NAME
basename \- strip filename affixes
.SH SYNOPSIS
.B basename
string [ suffix ]
.SH DESCRIPTION
.I Basename
deletes any prefix ending in `/' and the
.I suffix,
if present in
.I string,
from
.I string,
and prints the result on the standard output.
It is normally used inside substitution marks \`\ \`
in shell procedures.
.PP
This shell procedure invoked with the argument
.I /usr/src/bin/cat.c
compiles the named file and moves the output to
.I cat
in the current directory:
.IP "" 15n
cc $1
.br
mv a.out \`basename $1 .c\`
.SH "SEE ALSO"
sh(1)