emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a table into a variable in a shell code block?


From: William Denton
Subject: Re: How to get a table into a variable in a shell code block?
Date: Sat, 3 Apr 2021 14:57:54 -0400 (EDT)
User-agent: Alpine 2.22 (DEB 394 2020-01-19)

On 3 April 2021, Greg Minshall wrote:

#+begin_src shell :results output :var n=numbers
echo ${n[1]}
#+end_src

Aha, it's in an array but I didn't see it! Thanks. Org was doing it magic but I got confused by bash.

#+NAME: numbers
| one   |
| two   |
| three |

#+begin_src shell :results output :var n=numbers
for i in "${n[@]}"; do
    echo $i
done
#+end_src

#+RESULTS:
: one
: two
: three

Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/         ---   GHG.EARTH: https://ghg.earth/
Caveat lector.                      ---   STAPLR: https://staplr.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]