fork download
  1. var=0
  2. arr=(
  3. \""str 1\""
  4. \""str 2\""
  5. $(
  6. if [[ $var == 1 ]]; then
  7. echo \""str 3\""
  8. echo \""str 4\""
  9. else
  10. echo \""str 5\""
  11. echo \""str 6\""
  12. fi
  13. )
  14. \""str 7\""
  15. )
  16.  
  17. arr2=(
  18. \""str 1\""
  19. \""str 2\""
  20. )
  21.  
  22. echo ${arr2[@]}
  23. echo ${#arr2[@]}
  24.  
  25. echo ${arr[@]}
  26. echo ${#arr[@]}
  27.  
Success #stdin #stdout 0.02s 5312KB
stdin
Standard input is empty
stdout
"str 1" "str 2"
2
"str 1" "str 2" "str 5" "str 6" "str 7"
7