diff options
Diffstat (limited to 'static/v10/man1/basename.1')
| -rw-r--r-- | static/v10/man1/basename.1 | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/static/v10/man1/basename.1 b/static/v10/man1/basename.1 new file mode 100644 index 00000000..2d984abd --- /dev/null +++ b/static/v10/man1/basename.1 @@ -0,0 +1,58 @@ +.TH BASENAME 1 +.CT 1 shell +.SH NAME +basename, dirname \- strip filename affixes +.SH SYNOPSIS +.B basename +.I string +[ +.I suffix +] +.PP +.B dirname +.I string +.SH DESCRIPTION +These functions split off useful parts of a pathname; +they are typically used inside substitution marks +.BR `\ ` +in shell scripts. +.PP +.I Basename +deletes any prefix ending in +.L / +and the +.I suffix, +if present in +.I string, +from +.I string, +and prints the result on the standard output. +.PP +.I Dirname +places on standard output the name of the directory in which +a file named +.I string +would nominally be found. +The calculation is syntactic and independent of +the contents of the file system. +.SH EXAMPLES +.TP +.L +cc $1 -o `basename $1 .c` +Compile into +.LR file , +where +.L $1 +is +.L file.c +or +.LR dir/file.c . +.TP +.L +cc $1 -o `dirname $1`/`basename $1 .c` +Compile +.LR dir/file.c +into +.LR dir/file . +.SH "SEE ALSO" +.IR sh (1) |
