mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 23:47:25 +00:00
cc565fc16c
Give the `command` builtin a single flag, -p/--path, that causes it to print the full path that would be executed for the given command.
20 lines
946 B
Text
20 lines
946 B
Text
\section command command - run a program
|
|
|
|
\subsection command-synopsis Synopsis
|
|
<tt>command [OPTIONS] COMMANDNAME [ARGS...]</tt>
|
|
|
|
\subsection command-description Description
|
|
|
|
\c command forces the shell to execute the program \c COMMANDNAME and ignore any functions or builtins with the same name.
|
|
|
|
The following options are available:
|
|
- \c -h or \c --help prints help and then exits.
|
|
- \c -p or \c --path returns the name of the disk file that would be executed, or nothing if no file with the specified name could be found in the <tt>$PATH</tt>.
|
|
|
|
With the \c -p option, \c command treats every argument as a separate command to look up and sets the exit status to 0 if any of the specified commands were found, or 1 if no commands could be found.
|
|
|
|
\subsection command-example Examples
|
|
|
|
<tt>command ls</tt> causes fish to execute the \c ls program, even if an 'ls' function exists.
|
|
|
|
<tt>command -p ls</tt> returns the path to the \c ls program.
|