There is nothing like that: Org babel evaluates the source block by storing all the commands in a temp file, runs the file using the appropriate language interpreter, collects the output, does minor munging to it and writes it out as the results block. What you are asking for (a header argument that modifies this work flow) is fundamentally incompatible with the basic babel model.
EDIT: I should have added a couple of possible ways to get what you want even if a bit inconveniently:
- one way is to have separate code blocks for each command as mentioned in the comments:
#+begin_src sh :exports both
echo "first line"
#+end_src
#+begin_src sh :exports both
echo "second line"
#+end_src
- a second way is to forego the export of the code and just export results, but make the code block output the commands as well as the output of those commands:
#+begin_src shell :results output :exports results :wrap example
cmd='echo "first line"'
echo "\$ $cmd"
eval $cmd
cmd='echo "second line"'
echo "\$ $cmd"
eval $cmd
#+end_src
- If you are using
bash
, you can use arrays to make the second method much more palatable:
#+begin_src shell :results output :exports results :wrap example
declare -a cmds=('echo "first line"'
'echo "second line"')
for cmd in "${cmds[@]}" ;do
echo "\$ $cmd"
eval $cmd
done
#+end_src
All you need to do is add more commands to the cmds
array: the rest of the code does not need to be touched.
:exports both-interleaved
:-) But I guess it's not present.