Skip to content

Files

Latest commit

 

History

History
29 lines (20 loc) · 458 Bytes

SC3006.md

File metadata and controls

29 lines (20 loc) · 458 Bytes

Pattern: Use of undefined ((..))

Issue: -

Description

In POSIX sh, standalone ((..)) is undefined.

Example of incorrect code:

variable=1
if ((variable)); then
  echo variable is not zero
fi

Example of correct code:

variable=1
if [ "${variable}" -ne 0 ]; then
  echo variable is not zero
fi

Further Reading