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

2021-04-03 Thread Michael Welle
Hello, William Denton writes: > 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. interestingly I asked a simila

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

2021-04-03 Thread Juan Manuel MacĂ­as
Hi Greg and William, Greg Minshall writes: > William, > > try > > #+begin_src shell :results output :var n=numbers > echo ${n[1]} > #+end_src > > cheers, Greg I don't know if I'm saying something wrong, but wouldn't it be better this way?: #+begin_src shell :results output :var n=numbers echo $

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

2021-04-03 Thread William Denton
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 out

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

2021-04-03 Thread Greg Minshall
William, try #+begin_src shell :results output :var n=numbers echo ${n[1]} #+end_src cheers, Greg

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

2021-04-03 Thread William Denton
Let's say I have a table like this: #+NAME: numbers | one | | two | | three | I want to run through those numbers in a shell code block, but it I pass in table as a variable, it only sees the first number. #+begin_src shell :results output :var n=numbers echo $n #+end_src #+RESULTS: : on