Listing integers

If we want to see all declared integer variables along with their values, then we must give the following command:

    $ declare -i

This should produce the following output:

    declare -ir BASHPID=""
    declare -ir EUID="1001"
    declare -i HISTCMD=""
    declare -i LINENO=""
    declare -i MAILCHECK="60"
    declare -i OPTIND="1"
    declare -ir PPID="1966"
    declare -i RANDOM=""
    declare -ir UID="1001"

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.