diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 21:07:28 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 21:07:28 -0400 |
| commit | 711594636704defae873be1a355a292505585afd (patch) | |
| tree | 59ee13f863830d8beba6cfd02bbe813dd486c26f /static/v10/man1/basename.1 | |
| parent | 3258a063c1f189d7b019e40e525b46bef9b9a7b1 (diff) | |
docs: Added UNIX V10 Manuals
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) |
