[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG] ob-shell may use /bin/sh instead of the specified shell when :cmdl
From: |
Ihor Radchenko |
Subject: |
[BUG] ob-shell may use /bin/sh instead of the specified shell when :cmdline is provided (was: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline) |
Date: |
Thu, 27 Jun 2024 13:00:31 +0000 |
Ihor Radchenko <yantar92@posteo.net> writes:
> As for the problem with <shell-file-name> <shell-command-switch> <script-file>
> when <script-file> does not contain shebang, we can trivially at that
> shebang like
>
> (with-temp-file script-file
> (if shebang (insert shebang "\n")
> (insert "#!" shell-file-name "\n"))
> (when padline (insert "\n"))
> (insert body))
I am branching off this bug into a new thread.
Reproducer:
#+begin_src dash
echo This must be empty in dash: "$RANDOM"
#+end_src
#+RESULTS:
: This must be empty in dash:
#+begin_src dash :cmdline 1 2 3
echo This must be empty in dash: "$RANDOM"
#+end_src
#+RESULTS:
: This must be empty in dash: 25561
The second code block uses shell as evidenced by $RANDOM variable being
initialized. This only happens when :cmdline header argument is
provided.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- [BUG] ob-shell may use /bin/sh instead of the specified shell when :cmdline is provided (was: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline),
Ihor Radchenko <=