Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 469 Bytes

SC2230.md

File metadata and controls

23 lines (14 loc) · 469 Bytes

Pattern: Use of non-standard which

Issue: -

Description

which is a non-standard, external tool that locates an executable in PATH. command -v is a POSIX standard builtin, which uses the same lookup mechanism that the shell itself would.

Example of incorrect code:

which grep

Example of correct code:

command -v grep

Further Reading