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.

comm<br />

Portability<br />

Related Information<br />

cmp, diff, sort, uniq<br />

Incorrect command-line options are reported but do not affect the exit status value.<br />

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

command — Run a simple command<br />

Format<br />

Description<br />

Options<br />

Example<br />

command [–p] command-name [argument...]<br />

command [–V|–v] command-name<br />

command causes the shell to suppress its function lookup and execute the given<br />

command-name and arguments as though they made up a standard command line.<br />

In most cases, if command-name is not the name of a function, the results are the<br />

same as omitting command. If, however, command-name is a special built-in<br />

command, (see sh), some unique properties of special built-in commands do not<br />

apply:<br />

v A syntax error in the command does not cause the shell running the command to<br />

stop.<br />

v Variable assignments specified with the special built-in command do not remain<br />

in effect after the shell has run the command.<br />

–p Searches for command-name using the system default PATH variable.<br />

–v Writes a string indicating the pathname or command that the shell uses to<br />

invoke command-name.<br />

–V Writes a string indicating how the shell interprets command-name. If<br />

command-name is a command, a regular built-in command, or an<br />

implementation-provided function found using the PATH variable, the string<br />

identifies it as such and includes the absolute pathname. If command-name<br />

is an alias, function, special built-in command, or reserved word, the string<br />

identifies it as such and includes its definition if it is an alias. If the<br />

command is a tracked alias, the string identifies it as cached.<br />

Typically, you use command when you have a command that may have the same<br />

name as a function. For example, here’s a definition of a cd function that not only<br />

switches to a new directory but also uses lc to list the contents of that directory:<br />

function cd {<br />

command cd $1<br />

lc<br />

}<br />

Inside the function, we use command to get at the real cd. If we didn’t do this, the<br />

cd function would call itself in an infinite recursion.<br />

142 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!