mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2230 (markdown)
@@ -1,5 +1,7 @@
|
|||||||
## which is non-standard. Use builtin 'command -v' instead.
|
## which is non-standard. Use builtin 'command -v' instead.
|
||||||
|
|
||||||
|
Note: This check is opt-in only in ShellCheck 0.7.1+ (`shellcheck -o deprecate-which`).
|
||||||
|
|
||||||
### Problematic code:
|
### Problematic code:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -18,7 +20,7 @@ command -v grep
|
|||||||
|
|
||||||
### Exceptions:
|
### Exceptions:
|
||||||
|
|
||||||
None
|
This check is opt-in only in 0.7.1+, and you may choose to [[ignore it]] in earlier versions. `which` is very common, and some prefer its executable-or-nothing behavior over `command -v`'s handling of builtins, functions and aliases.
|
||||||
|
|
||||||
### Caveats:
|
### Caveats:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user