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