Techno World Inc - The Best Technical Encyclopedia Online!

THE TECHNO CLUB [ TECHNOWORLDINC.COM ] => Shell Script => Topic started by: Mark David on March 16, 2007, 01:06:42 PM



Title: bash array operations
Post by: Mark David on March 16, 2007, 01:06:42 PM
bash array operations

sometimes we need to remove one element from an array for example we remove the element 2 (third) from array

Code:
array=("hello" "i" "like" "bash") 
i=2
array=(${array[@]:0:$i} ${array[@]:$(($i + 1))})