declare -i num=5

Category: Shell & Bash

declare -i num=5

Declare an integer variable

Declares a variable that can only hold integers. -i means 'integer'. Arithmetic operations will work correctly on it.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.