emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdl


From: Ihor Radchenko
Subject: Re: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline
Date: Sun, 28 Apr 2024 12:34:34 +0000

Max Nikulin <manikulin@gmail.com> writes:

>> I conclude that your concern, while being valid, is a _different_ bug.
>> Thus, I do not see it as a blocker for my patch - my patch will fix the
>> *original bug reported on top of this thread*.
>
> My concern is that your patch trying to fix one bug (I am not convinced 
> it is an improvement despite it is a step toward consistency) introduces 
> another one that is not currently present in the code.

May you explain which bug you are referring to?

The bug with bash -c ./script-with-no-shebang described in
https://superuser.com/questions/502984/writing-shell-scripts-that-will-run-on-any-shell-using-multiple-shebang-lines
is already present, and my patch does not change anything about it.

>> (with-temp-file script-file
>>              (if shebang (insert shebang "\n")
>>                    (insert "#!" shell-file-name "\n"))
>>              (when padline (insert "\n"))
>>              (insert body))
>
> This code has an issue. Interpretation of relative file names in 
> shebangs varies across shells.

May you elaborate? Are you concerned that `shell-file-name' may not be
an absolute path?

> If you insist on parsing :cmdline by shell (I do not like it) then you 
> may try
>
> <shell-file-name> <shell-command-switch> '<shell-file-name> 
> <script-file> <cmdline>'

May you explain how it is better?

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]