Skip to content

Commit

Permalink
Update BASH-TRANSLATION-EXAMPLES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
friendly-bits authored Dec 12, 2023
1 parent 011787c commit d2ca74f
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions BASH-TRANSLATION-EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'"`

##

Expand All @@ -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:
Expand Down

0 comments on commit d2ca74f

Please sign in to comment.