posix.rst
changeset 774 74461231e9e7
parent 467 382333a5d87d
equal deleted inserted replaced
771:4c821e214e3a 774:74461231e9e7
     5   http://www.opengroup.org/onlinepubs/009695399/download
     5   http://www.opengroup.org/onlinepubs/009695399/download
     6                 download page for SYSV3
     6                 download page for SYSV3
     7 
     7 
     8   http://www.opengroup.org/onlinepubs/9699919799/download
     8   http://www.opengroup.org/onlinepubs/9699919799/download
     9                 download page for SYSV4
     9                 download page for SYSV4
       
    10 
       
    11 * Shell command.
       
    12 
       
    13 ** command.
       
    14 
       
    15 Main semantic is to invoke command instead defined function with same name:
       
    16 
       
    17   $ ls() { ls --color "$@"; }
       
    18   $ ls                          # infinitely loop as func invoke itself
       
    19   $ ls() { command ls --color "$@"; }
       
    20   $ ls .                        # invoke /bin/ls with color output
       
    21   $ unset ls                    # forget func definition
       
    22   $ ls                          # invoke /bin/ls without color output
       
    23 
       
    24 With '-p' arg Perform the command search using a default value for PATH that
       
    25 is guaranteed to find all of the standard utilities:
       
    26 
       
    27   $ command -p getconf PATH
       
    28 
       
    29 
       
    30 With '-v' arg work like 'which' command which not included in POSIX:
       
    31 
       
    32   $ command -v ls
       
    33 /usr/bin/ls
       
    34   $ command -v echo             # for build-in command print command itself
       
    35 echo                            # you can check for equality or for slash to
       
    36                                 # distinguish from utilities