Adds simpler push for bash array (#894)
Here is a less verbose push than the one listed
This commit is contained in:
parent
117e9905d8
commit
6164a16f57
1
bash.md
1
bash.md
|
@ -425,6 +425,7 @@ echo ${Fruits[@]:3:2} # Range (from position 3, length 2)
|
|||
|
||||
```bash
|
||||
Fruits=("${Fruits[@]}" "Watermelon") # Push
|
||||
Fruits+=('Watermelon') # Also Push
|
||||
Fruits=( ${Fruits[@]/Ap*/} ) # Remove by regex match
|
||||
unset Fruits[2] # Remove one item
|
||||
Fruits=("${Fruits[@]}") # Duplicate
|
||||
|
|
Loading…
Reference in New Issue