Quick example of how to use table data in a source block with Bash:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #+name: data | 1 | | 2 | | 3 | | 4 | #+name: code #+begin_src sh :var arg=data :results output printf "%s\n" "${arg[@]}" #+end_src #+RESULTS: code #+begin_EXAMPLE 1 2 3 4 #+end_EXAMPLE |
Here is how the block expands using org-babel-expand-src-block
:
1 2 3 | unset arg declare -a arg=( '1' '2' '3' '4' ) printf "%s\n" "${arg[@]}" |