Quick follow up about this: following Eric's suggestion, I came up with the following block, which cleans up all the cruft from the output of the =script= command and produces a nicely formatted session transcript:
#+NAME: cleanup
#+BEGIN_SRC emacs-lisp :var data="" :results value :exports none
(replace-regexp-in-string
"\\$ exit\\(.\\|\n\\)*$" ""
(replace-regexp-in-string
"^bash-.*\\$" "$"
(replace-regexp-in-string
"\\(\\(.\\|\n\\)*?\\)\\$\\(.\\|\n\\)*\\'" ""
(replace-regexp-in-string "
" "" data) nil nil 1)))
#+END_SRC
(I am not happy with the regexp nesting and repetition above, I am not an expert yet in emacs-lisp regex facilities. Suggestions appreciated for how to simplify it).
This produces exactly the result I need:
#+begin_src sh :exports output :results output :wrap "src console" :post cleanup(data=*this*)
script <<EOF
echo hi
echo bye
EOF
#+end_src
#+RESULTS:
#+begin_src console
$ echo hi
hi
$ echo bye
bye
#+end_src
Thanks Eric!
--Diego