0

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
3
  • 1
    sh is the lowest common denominator of shells. Try #+begin_src bash instead. Commented Dec 14, 2022 at 17:36
  • See the ob-shell doc on Worg for details. Commented Dec 14, 2022 at 18:05
  • @NickD Thanks, yes change to bash works. but another issue with bash, I have submitted a new SO emacs.stackexchange.com/questions/74972/… Commented Dec 14, 2022 at 19:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.