Hello
I have a problem.
I create a Multidimensional Array Like this:
ENTRY["HOST1"]="$kunnum-$host"
ENTRY["HOST2"]="$host"
ENTRY["COMMENT"]="# $3"
for key in "${!ENTRY[@]}"; do
ENTRIES[$2"5",$key]=${ENTRY[$key]} # INDEX=IP(5)
done
declare -p
declare -A ENTRIES=([205,HOST1]="unas15533" [205,HOST2]="unas" [1025,COMMENT]="# RDP-Terminal 2" [775,COMMENT]="# WLAN Access Point" [1015,IP]="111.122.133.101" [1025,IP]="111.122.133.102" [775,IP]="111.122.133.77" [205,COMMENT]="# UNAS" [775,HOST1]="15533-wlan" [1015,HOST2]="rdp1" [1015,HOST1]="15533-rdp1" [775,HOST2]="wlan" [1015,COMMENT]="# RDP-Terminal 1" [1025,HOST2]="rdp2" [1025,HOST1]="15533-rdp2" [205,IP]="111.122.133.20" )
Now i have to sort this by the "INDEX"
([205,HOST1]="unas15533"
in this case it would be 205
I have to sort all elements and then i want to give them formated out.
How can I sort this array?
Thank you so much for your help.