source: trunk/minix/man/man1/basename.1@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 815 bytes
RevLine 
[9]1.TH BASENAME 1
2.SH NAME
3basename, dirname \- strip off file prefixes and suffixes
4.SH SYNOPSIS
5\fBbasename \fIfile\fR [\fIsuffix\fR]\fR
6.br
7\fBdirname \fIfile\fR
8.de FL
9.TP
10\\fB\\$1\\fR
11\\$2
12..
13.de EX
14.TP 20
15\\fB\\$1\\fR
16# \\$2
17..
18.SH EXAMPLES
19.EX "basename /user/ast/file.c" "Strips path to yield \fIfile.c\fP"
20.EX "basename /user/file.c .c" "Strips path and \fI.c\fP to yield \fIfile\fP"
21.EX "dirname /user/file.c" "Strips basename to yield \fI/user\fP"
22.SH DESCRIPTION
23.PP
24.I Basename
25removes the initial directory names (if any) yielding the name of the
26file itself.
27If a second argument is present, it is interpreted as a suffix and is
28also stripped, if present.
29.PP
30.I Dirname
31removes the final component of a path, yielding the directory a file is in.
32.PP
33These programs are primarily used in shell scripts.
Note: See TracBrowser for help on using the repository browser.