emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Variables not set during tangle of sh code (org 9.5)
@ 2020-11-18 11:34 Robby Kiggen | Essential IT
  2020-12-13  6:32 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Robby Kiggen | Essential IT @ 2020-11-18 11:34 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

in  OrgMode  9.5 it seems that the variables during the tangling of sh
aren't set/initialized.

For example the block below:
#+begin_src sh :var str="Hello World" :tangle helloworld.sh
echo $str
#+end_src

Gets tangled into:
echo $str

Which means the str="Hello World" line is missing.

I tried this with an emacs block and that seemed to be working.

The following block:

#+begin_src emacs-lisp :var data1=8 data2=16 :tangle test.lsp
(message "data1:%S, data2:%S" data1 data2)
#+end_src

Was tangled to:
(let ((data1 '8)
      (data2 '16))
(message "data1:%S, data2:%S" data1 data2)
)

This leads me to believe that there is a bug in ob-shell.el.


-- 
Best regards,
Robby Kiggen | Essential IT



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

* Re: Variables not set during tangle of sh code (org 9.5)
  2020-11-18 11:34 Variables not set during tangle of sh code (org 9.5) Robby Kiggen | Essential IT
@ 2020-12-13  6:32 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2020-12-13  6:32 UTC (permalink / raw)
  To: Robby Kiggen | Essential IT; +Cc: emacs-orgmode


Robby Kiggen | Essential IT writes:

> Hi,
>
> in  OrgMode  9.5 it seems that the variables during the tangling of sh
> aren't set/initialized.
>
> For example the block below:
> #+begin_src sh :var str="Hello World" :tangle helloworld.sh
> echo $str
> #+end_src
>
> Gets tangled into:
> echo $str
>
> Which means the str="Hello World" line is missing.

My guess is that you haven't loaded ob-shell, as that's how I can
reproduce what you report.  After (require 'ob-shell), I see

  str='Hello World'
  echo $str


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

end of thread, other threads:[~2020-12-13  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-18 11:34 Variables not set during tangle of sh code (org 9.5) Robby Kiggen | Essential IT
2020-12-13  6:32 ` Kyle Meyer

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).