Below bash script works as a bash script but if execute it in org-babel block as below, it report error:
sh: 2: Bad substitution
code:
#+begin_src sh :results output
str="toto.titi.12.tata.2.abc.def"
arr=${str//[!0-9]/ }
echo "${arr[@]}"
#+end_src
sh
is the lowest common denominator of shells. Try#+begin_src bash
instead.