AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

f) .. .... ._ __ . ·

BASE NAME ( 1 ) BASE NAME ( 1 ) NAME basename, dirname - deliver portions of path names SYNOPSIS basename string [ suffix ] dirname string DESCRIPTION Basename deletes any prefix ending in I and the suffix (if present in string ) from string, and prints the result on the standard output. It is normally used inside substitution marks ( ' ' ) within shell procedures. Dirname delivers all but the last level of the path name in string . EXAMPLES The following example, invoked with the I usr I srcl cmdl cat.c, compiles the named file and output to a file named cat in the current directory: cc $1 argument moves the mv a.out 'basename $1 .c' The following example will set the shell variable NAME to lusrlsrclcmd: NAME= 'dirname /usr/src/cmd/cat.c' SEE ALSO sh( 1). BUGS The basename of I is null and is considered an error. - 1 -

BASE NAME ( 1 ) BASE NAME ( 1 )<br />

NAME<br />

basename, dirname - deliver portions of path names<br />

SYNOPSIS<br />

basename string [ suffix ]<br />

dirname string<br />

DESCRIPTION<br />

Basename deletes any prefix ending in I and the suffix (if present<br />

in string ) from string, and prints the result on the standard output.<br />

It is normally used inside substitution marks ( ' ' ) within<br />

shell procedures.<br />

Dirname delivers all but the last level of the path name in string .<br />

EXAMPLES<br />

The following example, invoked with the<br />

I usr I srcl cmdl cat.c, compiles the named file and<br />

output to a file named cat in the current directory:<br />

cc $1<br />

argument<br />

moves the<br />

mv a.out 'basename $1 .c'<br />

The following example will set the shell variable NAME to<br />

lusrlsrclcmd:<br />

NAME= 'dirname /usr/src/cmd/cat.c'<br />

SEE ALSO<br />

sh( 1).<br />

BUGS<br />

The basename of I is null and is considered an error.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!