From 6164a16f57cf9665642ba72264f7b3ea7a8f4c07 Mon Sep 17 00:00:00 2001 From: Paul Cathey Date: Fri, 16 Nov 2018 11:58:15 -0800 Subject: [PATCH] Adds simpler push for bash array (#894) Here is a less verbose push than the one listed --- bash.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bash.md b/bash.md index a4c54dc82..15e0d98e0 100644 --- a/bash.md +++ b/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