xref: /illumos-gate/usr/src/man/man1b/basename.1b (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
te
Copyright (c) 1995, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
BASENAME 1B "Mar 28, 1995"
NAME
basename - display portions of pathnames
SYNOPSIS

/usr/ucb/basename string [suffix]
DESCRIPTION

The basename utility deletes any prefix ending in `/' and the suffix, if present in string. It directs the result to the standard output, and is normally used inside substitution marks (` `) within shell procedures. The suffix is a string with no special significance attached to any of the characters it contains.

EXAMPLES

Example 1 Using the basename command.

This shell procedure invoked with the argument /usr/src/bin/cat.c compiles the named file and moves the output to cat in the current directory:

example% cc $1
example% mv a.out `basename $1 .c`
SEE ALSO

sh (1), attributes (7)