File: command.txt

package info (click to toggle)
fish 3.0.2-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,448 kB
  • sloc: ansic: 75,559; cpp: 43,314; sh: 9,096; javascript: 7,710; python: 2,538; makefile: 1,461; objc: 709; perl: 367; xml: 18
file content (30 lines) | stat: -rw-r--r-- 1,429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\section command command - run a program

\subsection command-synopsis Synopsis
\fish{synopsis}
command [OPTIONS] COMMANDNAME [ARGS...]
\endfish

\subsection command-description Description

`command` forces the shell to execute the program `COMMANDNAME` and ignore any functions or builtins with the same name.

The following options are available:

- `-a` or `--all` returns all the external commands that are found in `$PATH` in the order they are found.

- `-q` or `--quiet`, in conjunction with `-s`, silences the output and prints nothing, setting only the exit code.

- `-s` or `--search` returns the name of the external command that would be executed, or nothing if no file with the specified name could be found in the `$PATH`.

With the `-s` option, `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. Additionally passing a `-q` or `--quiet` option prevents any paths from being printed, like `type -q`, for testing only the exit status.

For basic compatibility with POSIX `command`, the `-v` flag is recognized as an alias for `-s`.

\subsection command-example Examples

`command ls` causes fish to execute the `ls` program, even if an `ls` function exists.

`command -s ls` returns the path to the `ls` program.

`command -sq git; and command git log` runs `git log` only if `git` exists.