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

2024-04-28 Thread Ihor Radchenko
Max Nikulin 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

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

2024-04-27 Thread Max Nikulin
On 27/04/2024 17:31, Max Nikulin wrote: On 26/04/2024 18:49, Ihor Radchenko wrote: +    shell-file-name ... +    (list shell-command-switch +  (concat (file-local-name script-file)  " " cmdline Max Nikulin writes:

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

2024-04-27 Thread Max Nikulin
On 26/04/2024 18:49, Ihor Radchenko wrote: +shell-file-name ... +(list shell-command-switch + (concat (file-local-name script-file) " " cmdline Max Nikulin writes: Using `shell-command-switch'

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

2024-04-27 Thread Ihor Radchenko
Matt writes: > There's a lot to process in this bug. We've also uncovered, at least, > related four bugs. I think it would help to submit separate bug reports for > each of the related issues so that we may discuss them separately, if > possible. Is Woof! the way to do that? I recall

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

2024-04-27 Thread Matt
Thank you both for your thoughtful replies. There's a lot to process in this bug. We've also uncovered, at least, related four bugs. I think it would help to submit separate bug reports for each of the related issues so that we may discuss them separately, if possible. Is Woof! the way to

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

2024-04-26 Thread Ihor Radchenko
Max Nikulin writes: > Actually script arguments (and :stdin) might be applied to python and at > least some other languages, so support of this feature should be moved > from ob-shell to common org-babel code. > > My point: > - header arguments should have as close as possible meaning across

[DISCUSSION] The meaning of :cmdline header argument across babel backends (was: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline)

2024-04-26 Thread Ihor Radchenko
Max Nikulin writes: > However looking wider, I do not like that :cmdline for ob-shell has > different meaning than for other languages, see e.g. ob-sql. Only for > shell this parameter is treated as arguments of a *script*. In other > cases :cmdline is used to specify arguments of

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

2024-04-26 Thread Ihor Radchenko
Ihor Radchenko writes: > Max Nikulin writes: > >>> +shell-file-name >> ... >>> +(list shell-command-switch >>> + (concat (file-local-name script-file) " " >>> cmdline >> >> Using `shell-command-switch'

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

2024-04-25 Thread Max Nikulin
On 24/04/2024 19:52, Ihor Radchenko wrote: Max Nikulin writes: I believe, multiple arguments should be specified as '(1 a "b c"). Yes, but we do not, in general, know how to split them. Something should be changed anyway since current behavior is inconsistent and so is buggy. The only

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

2024-04-24 Thread Ihor Radchenko
Max Nikulin writes: >> +shell-file-name > ... >> +(list shell-command-switch >> + (concat (file-local-name script-file) " " >> cmdline > > Using `shell-command-switch' unconditionally may lead to executing >

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

2024-04-24 Thread Max Nikulin
On 23/04/2024 17:28, Ihor Radchenko wrote: I propose the attached patch. +++ b/lisp/ob-shell.el @@ -322,14 +322,12 @@ (defun org-babel-sh-evaluate (session body params stdin cmdline) (with-temp-buffer (with-connection-local-variables (apply

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

2024-04-23 Thread Max Nikulin
On 23/04/2024 17:51, Max Nikulin wrote: I am in favor of dropping `shell-command-switch' in the latter case to pass arguments literally in both cases. Dropping "-c" may have side effects. Instead of :shebang, a source block may have shebang in the body #+begin_src bash #!/bin/bash -e echo

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

2024-04-23 Thread Max Nikulin
On 21/04/2024 22:09, Matt wrote: The proposed solution assumes we intend to parse the characters following :cmdline as space delimited and grouped by quotes. However, AFAICT, the parsing issue makes this solution ambiguous. Matt, I am sorry, but I do not agree with your proposal. I do not

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

2024-04-23 Thread Ihor Radchenko
Matt writes: > Whether this is a solution, in part, depends on the perennial problem of > shell blocks: knowing what's wrong means knowing what's right. > > The proposed solution assumes we intend to parse the characters following > :cmdline as space delimited and grouped by quotes. However,

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

2024-04-21 Thread Matt
On Sat, 18 Nov 2023 16:54:39 +0100 Max Nikulin wrote --- > Hi, > > Trying to figure out the origin of the confusion with > "bash -c bash /path/to/file-containing-the-source-code.sh" > I have faced an inconsistency with :cmdline treatment in ob-shell.el. I > expect same results in