16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Related Information<br />

cmp, diff<br />

dirname — Return the directory components of a pathname<br />

Format<br />

Description<br />

Examples<br />

Localization<br />

Exit Values<br />

Portablity<br />

dirname pathname<br />

dirname deletes the trailing part of a filename. The result is the pathname of the<br />

directory that contains the file. This is useful in shell scripts. dirname does not try<br />

to validate the pathname. For validation, use pathchk.<br />

dirname follows these rules:<br />

1. If pathname is //, return it.<br />

2. Otherwise, if it is all slashes, return one slash.<br />

3. Otherwise, remove all trailing slashes.<br />

4. If there are no slashes remaining in pathname, return period (.).<br />

5. Otherwise, remove trailing nonslash characters.<br />

6. If the remaining string is //, return it.<br />

7. Otherwise, remove any trailing slashes.<br />

8. If the resulting string is empty, return period (.).<br />

9. Otherwise, return the resulting string.<br />

The command:<br />

dirname src/lib/printf.c<br />

produces:<br />

src/lib<br />

dirname uses the following localization environment variables:<br />

v LANG<br />

v LC_ALL<br />

v LC_CTYPE<br />

v LC_MESSAGES<br />

v NLSPATH<br />

See Appendix F for more information.<br />

0 Successful completion<br />

1 Failed<br />

2 Unknown command-line option<br />

Related Information<br />

basename, pathchk<br />

P<strong>OS</strong>IX.2, X/Open Portability Guide, <strong>UNIX</strong> systems.<br />

dircmp<br />

Chapter 2. Shell command descriptions 241

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

Saved successfully!

Ooh no, something went wrong!