4.3. Bash Variables Are Untyped

Unlike many other programming languages, Bash does not segregate
its variables by "type". Essentially, Bash
variables are character strings, but, depending on context, Bash
permits integer operations and comparisons on variables. The
determining factor is whether the value of a variable contains
only digits.

Untyped variables are both a blessing and a curse. They permit
more flexibility in scripting (enough rope to hang yourself!) and
make it easier to grind out lines of code. However, they permit
errors to creep in and encourage sloppy programming habits.

The burden is on the programmer to keep track of what type the
script variables are. Bash will not do it for you.