emacs-orgmode
[Top][All Lists]
Advanced

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

processing a literal example line by line in a shell source block?


From: Greg Minshall
Subject: processing a literal example line by line in a shell source block?
Date: Wed, 02 Nov 2022 11:17:25 -0700

hi.  i have a text in a named #+begin_example ... #+end_example block.
i would like to process this text line by line in a shell (bash, say)
code block.  but, it appears that the individual lines are not
separated, but passed as one long string to the source block.  (example
below.)

is there a magic incantation i can use to accomplish this?

cheers, Greg

#+name: lbl
#+begin_example
line 1
line 2
#+end_example

#+begin_src bash :var input=lbl :var in2='("first" "second")
  echo ${#input[@]}
  echo ${#in2[@]}
  echo ${input}
#+end_src

#+RESULTS:
|    1 |   |      |   |
|    2 |   |      |   |
| line | 1 | line | 2 |



reply via email to

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