0
0

Update bash-array-with-spaces.sh

This commit is contained in:
DrMaxNix 2024-05-31 23:06:35 +02:00
parent 6f3ad133c8
commit 8fbbb299c2

View File

@ -1,6 +1,8 @@
#!/bin/bash
set -euo pipefail
## SOLUTION 1 ##
local oldifs="${IFS}"
IFS=""
for s in ${out_section_list[*]:-}; do
@ -9,3 +11,10 @@ done
out_section_list=(${out_section_list[@]:-""} "$section_name")
out_section_list=(${out_section_list[@]:-""} "bad evil name")
IFS="${oldifs}"
## SOLUTION 2 ##
local -n workplace_section="ini__${workplace_name}"
for k in "${!workplace_section[@]}"; do
log_debug "$k"
done