emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* processing a literal example line by line in a shell source block?
@ 2022-11-02 18:17 Greg Minshall
  2022-11-03  7:41 ` Ihor Radchenko
  2022-11-04  3:15 ` Max Nikulin
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Minshall @ 2022-11-02 18:17 UTC (permalink / raw)
  To: orgmode

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 |


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-07  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 18:17 processing a literal example line by line in a shell source block? Greg Minshall
2022-11-03  7:41 ` Ihor Radchenko
2022-11-04  2:14   ` Greg Minshall
2022-11-07  1:38   ` Greg Minshall
2022-11-04  3:15 ` Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).