diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2010-07-14 11:42:06 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2010-07-14 11:42:06 -0700 |
commit | 57bfa1989d19bd4cfce32f221a8edfea4bc46557 (patch) | |
tree | 886cf4291195f64922bdad247d1767b9a6627bd6 | |
parent | f904376df4d6e295ce5185f7f01fc76a4a1d4935 (diff) | |
download | org-mode-57bfa1989d19bd4cfce32f221a8edfea4bc46557.tar.gz |
ob-sh: can now handle variable strings which contain newlines
* lisp/ob-sh.el (org-babel-sh-var-to-sh): shell can now handle input
strings which contain newlines
-rw-r--r-- | lisp/ob-sh.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/ob-sh.el b/lisp/ob-sh.el index f327d22..fb9dd53 100644 --- a/lisp/ob-sh.el +++ b/lisp/ob-sh.el @@ -113,7 +113,11 @@ var of the same value." (format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)" (orgtbl-to-generic (deep-string var) (list :sep (or sep "\t"))))) - (if (stringp var) (format "%s" var) (format "%S" var)))) + (if (stringp var) + (if (string-match "[\n\r]" var) + (format "$(cat <<BABEL_STRING\n%s\nBABEL_STRING\n)" var) + (format "%s" var)) + (format "%S" var)))) (defun org-babel-sh-table-or-results (results) "Convert RESULTS to an appropriate elisp value. |