Guest User

Untitled

a guest
Nov 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. $ len=${#myarr[@]}
  2. $ indices=($(seq 1 $((len-2))))
  3. $ newarr=("${myarr[0]}")
  4. $ for i in ${indices[@]}; do newarr+=( "${myarr[i]}" "${myarr[i]}"); done
  5. $ newarr+=(${myarr[-1]})
Add Comment
Please, Sign In to add comment