BASENAME(1) DOMAIN/IX Reference Manual (SYS5) BASENAME(1)
NAME
basename, dirname - deliver portions of pathnames
USAGE
basename string [ suffix ]
dirname string
DESCRIPTION
Basename deletes from string any prefix ending with a slash
(/), as well as any suffix present. It then prints the
result on the standard output. Basename is normally used
inside substitution marks (``) within Shell procedures.
Dirname delivers all but the last level of the pathname in
string.
EXAMPLES
To remove a specified suffix of c from the prog.c string,
and produce prog as the resulting output, type the follow-
ing:
basename prog.c .c
To set the Shell variable NAME to /usr/cmd, specify this:
NAME= `dirname /usr/cmd/cat.c`
CAUTIONS
The basename of / is null and considered an error.
RELATED INFORMATION
sh (1).
Printed 6/10/85 BASENAME-1