BASENAME(1) UNIX Programmer's Manual BASENAME(1)
basename - strip filename affixes
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
b
\bba
\bas
\bse
\ben
\bna
\bam
\bme
\be string [ suffix ]
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
_
\bB_
\ba_
\bs_
\be_
\bn_
\ba_
\bm_
\be deletes any prefix ending in `/' and the _
\bs_
\bu_
\bf_
\bf_
\bi_
\bx, if
present in _
\bs_
\bt_
\br_
\bi_
\bn_
\bg, from _
\bs_
\bt_
\br_
\bi_
\bn_
\bg, and prints the result on the
standard output. It is normally used inside substitution
marks ` ` in shell procedures.
This shell procedure invoked with the argument
/_
\bu_
\bs_
\br/_
\bs_
\br_
\bc/_
\bb_
\bi_
\bn/_
\bc_
\ba_
\bt._
\bc compiles the named file and moves the
output to _
\bc_
\ba_
\bt in the current directory:
mv a.out `basename $1 .c`
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
Printed 7/9/88 April 29, 1985 1