local

Declare local variables and give them attributes. More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>.

Install

All systems
curl cmd.cat/local.sh
Debian Debian
apt-get install postfix
Ubuntu
apt-get install postfix
Alpine
apk add postfix
Arch Arch Linux
pacman -S postfix
image/svg+xml Kali Linux
apt-get install postfix
CentOS
yum install postfix
Fedora
dnf install postfix
Windows (WSL2)
sudo apt-get update sudo apt-get install postfix
Raspbian
apt-get install postfix
Docker
docker run cmd.cat/local local powered by Commando

Declare local variables and give them attributes. More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>.

  • Declare a string variable with the specified value:
    local variable="value"
  • Declare an integer variable with the specified value:
    local -i variable="value"
  • Declare an array variable with the specified value:
    local variable=(item_a item_b item_c)
  • Declare an associative array variable with the specified value:
    local -A variable=([key_a]=item_a [key_b]=item_b [key_c]=item_c)
  • Declare a readonly variable with the specified value:
    local -r variable="value"

© tl;dr; authors and contributors