Research V7 development
[unix-history] / usr / man / man1 / basename.1
CommitLineData
9789f6d4
KT
1.TH BASENAME 1
2.SH NAME
3basename \- strip filename affixes
4.SH SYNOPSIS
5.B basename
6string [ suffix ]
7.SH DESCRIPTION
8.I Basename
9deletes any prefix ending in `/' and the
10.I suffix,
11if present in
12.I string,
13from
14.I string,
15and prints the result on the standard output.
16It is normally used inside substitution marks \`\ \`
17in shell procedures.
18.PP
19This shell procedure invoked with the argument
20.I /usr/src/cmd/cat.c
21compiles the named file and moves the output to
22.I cat
23in the current directory:
24.IP "" 15n
25cc $1
26.br
27mv a.out \`basename $1 .c\`
28.SH "SEE ALSO"
29sh(1)