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