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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

awk<br />

Portability<br />

The parser stack depth is limited to 150 levels. Attempting to process extremely<br />

complicated programs may result in an overflow of this stack, causing an error.<br />

Input must be text files.<br />

Related information<br />

ed, egrep, sed, vi<br />

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

The ord function is an extension to traditional implementations of awk. The<br />

toupper and tolower functions and the ENVIRON array are in P<strong>OS</strong>IX and the<br />

<strong>UNIX</strong> <strong>System</strong> V Release 4 version of awk. This version is a superset of New awk,<br />

as described in The AWK Programming Language by Aho, Weinberger, and<br />

Kernighan.<br />

The standard command interpreter that the system function uses and that awk uses<br />

to run pipelines for getline, print, and printf is system-dependent. On z/<strong>OS</strong> <strong>UNIX</strong>,<br />

this interpreter is always /bin/sh.<br />

For more information about regexp, see Appendix C, “Regular Expressions<br />

(regexp).”<br />

basename — Return the nondirectory components of a pathname<br />

Format<br />

Description<br />

Examples<br />

Localization<br />

basename name [suffix]<br />

basename strips off the leading part of a pathname, leaving only the final<br />

component of the name, which is assumed to be the filename. To accomplish this,<br />

basename first checks to see if name consists of nothing but slash (/) characters.<br />

If so, basename replaces name with a single slash and the process is complete. If<br />

not, basename removes trailing slashes. If slashes still remain, basename strips off<br />

all leading characters up to and including the final slash. Finally, if you specify suffix<br />

and the remaining portion of name contains a suffix that matches suffix, basename<br />

removes that suffix.<br />

The command:<br />

basename src/dos/printf.c<br />

produces:<br />

printf.c<br />

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

v LANG<br />

v LC_ALL<br />

v LC_CTYPE<br />

v LC_MESSAGES<br />

48 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

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

Saved successfully!

Ooh no, something went wrong!