declare ausgelagert.

This commit is contained in:
2025-09-08 09:33:48 +02:00
parent 0d67903acf
commit 4bd2566b04
2 changed files with 13 additions and 0 deletions

20
arrays/create.sh Executable file
View File

@@ -0,0 +1,20 @@
#! /usr/bin/bash
a1=(0 1 2 3 4)
family=("Marge" "Homer" "Bart" "Lisa" "Maggie")
echo "a1=${a1[@]}"
echo "family=${family[@]}"
echo "Länge family: ${#family[@]}"
# Define an Array with declare -a
declare -a sbc
sbc[0]="Raspberry Pi"
echo "Länge sbc: ${#sbc[@]}"
echo "sbc=${sbc[@]}"
sbc[1]="Orange Pi"
echo "Länge sbc: ${#sbc[@]}"
echo "sbc=${sbc[@]}"
sbc[2]="Banana Pi"
echo "Länge sbc: ${#sbc[@]}"
echo "sbc=${sbc[@]}"