From d2ca74f4c267d9b014544f418abb7eb94845c425 Mon Sep 17 00:00:00 2001 From: blunderful-scripts <134004289+blunderful-scripts@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:20:03 +0200 Subject: [PATCH] Update BASH-TRANSLATION-EXAMPLES.md --- BASH-TRANSLATION-EXAMPLES.md | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/BASH-TRANSLATION-EXAMPLES.md b/BASH-TRANSLATION-EXAMPLES.md index c7f1ef5..d5af02e 100644 --- a/BASH-TRANSLATION-EXAMPLES.md +++ b/BASH-TRANSLATION-EXAMPLES.md @@ -131,27 +131,16 @@ POSIX-arrays: `set_a_arr_el test_arr key="test value"` ## -Bash: `echo "value for 'key': '${test_arr[key]}'"` - -POSIX-arrays: `get_a_arr_val test_arr value; echo "value for 'key': '$value'"` - -## - Bash: `unset test_arr[key]` POSIX-arrays: `unset_a_arr_el test_arr key` ## -Bash: `echo "test_arr has '${#test_arr[@]}' elements"` - -POSIX-arrays: `get_a_arr_el_cnt test_arr el_cnt; echo "test_arr has '$el_cnt' elements"` - -## +### Getting values, keys and parameters -### Unsetting arrays -Bash: `unset temp_arr` +Bash: `echo "value for 'key': '${test_arr[key]}'"` -POSIX-arrays: `unset_i_arr temp_arr` +POSIX-arrays: `get_a_arr_val test_arr value; echo "value for 'key': '$value'"` ## @@ -171,6 +160,11 @@ Bash: `echo "test_arr has '${#test_arr[@]}' elements"` POSIX-arrays: `get_a_arr_el_cnt test_arr el_cnt; echo "test_arr has '$el_cnt' elements"` +### Unsetting arrays +Bash: `unset temp_arr` + +POSIX-arrays: `unset_i_arr temp_arr` + ### Working with loops Bash: