Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > C


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


command — execute a simple command


command command_name [argument ...]


command enables the shell to treat the arguments as a simple command, suppressing the shell function lookup.

If command_name is not the name of the function, the effect of command is the same as omitting command.


command recognizes the following operands:


The name of a HP-UX command or a shell built-in command.


One or more strings to be interpreted as arguments to command_name.

The command command is necessary to allow functions that have the same name as a command to call the command (instead of a recursive call to the function).

Nothing in the description of command is intended to imply that the command line is parsed any differently than any other simple command. For example,

command a | b ; c

is not parsed in any special way that causes | or ; to be treated other than a pipe operator or semicolon or that prevents function lookup on b or c.


Environment Variables

PATH determines the search path used during the command search.


command exits with one of the following values:

  • If command fails:


    The utility specified by the command_name is found but not executable.


    An error occurred in the command utility or the utility specified by command_name is not found.

  • If command does not fail:

    The exit status of command is the same as that of the simple command specified by the arguments: command_name[argument ...]


Create a version of the cd command that always prints the name of the new working directory whenever it is used:

cd() { command "$@" >/dev/null pwd }

Circumvent the redefined cd command above, and change directories without printing the name of the new working directory:

command cd


command: XPG4, POSIX.2

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.