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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.