Re: [BUG] ob-shell: :cmdline fails with single argument (was Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline)

2023-11-18 Thread Matt
On Sun, 19 Nov 2023 07:57:26 +0100 Max Nikulin wrote --- > I would say that :cmdline is treated in a different way in comparison to > :var: It most definitely is. It's a completely separate process from :var.

Re: [BUG] ob-shell: :cmdline fails with single argument (was Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline)

2023-11-18 Thread Max Nikulin
On 19/11/2023 01:20, Matt wrote: #+begin_src bash :cmdline 1 echo "$1" #+end_src Then it fails with list: Wrong type argument: sequencep, 1 I would say that :cmdline is treated in a different way in comparison to :var: #+header: :results verbatim #+begin_src bash :var arr='(1 2 3)

Non-emacs shell (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Max Nikulin
On 17/11/2023 22:47, Bruno Barbier wrote: FWIW, M-x shell differs from what a plain terminal is doing (xterm, in my case), but, I do prefer 'M-x shell' behavior: it allows me to copy multiple lines, getting the same results as when I type them manually, or copy them line by line. My xterm

Re: Suggestion: User-contributed use-cases on orgmode.org ?

2023-11-18 Thread David Masterson
Ihor Radchenko writes: > David Masterson writes: > >>> Would it help if we change it to >>> >>> It is made of numerous .org files from https://git.sr.ht/~bzg/worg. >>> >>> ? >> >> Perhaps: >> >> Follow the link https://git.sr.ht/~bzg/worg for information (including >> cloning) on the WORG

[BUG] ob-shell: :cmdline fails with single argument (was Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline)

2023-11-18 Thread Matt
On Sat, 18 Nov 2023 16:54:39 +0100 Max Nikulin wrote --- > I have faced an inconsistency with :cmdline treatment in ob-shell.el. These are sadly easy to find. If you run: #+begin_src bash :cmdline 1 echo "$1" #+end_src Then it fails with list: Wrong type argument: sequencep,

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

2023-11-18 Thread Matt
On Sat, 18 Nov 2023 16:54:39 +0100 Max Nikulin wrote --- > I have faced an inconsistency with :cmdline treatment in ob-shell.el. I > expect same results in the following cases: > > #+begin_src bash :cmdline 1 2 3 >printf "%s\n" "$1" > #+end_src > > #+RESULTS: > : 1 >

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Max Nikulin
On 18/11/2023 17:43, Ihor Radchenko wrote: I still see it as a bug - what Org mode does to run the shell blocks is not what users expect. _By default_, we _should_ produce more expected behavior. A shell without unexpected behavior is neither POSIX nor a descendant shell like BASH

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

2023-11-18 Thread Max Nikulin
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 the following cases: #+begin_src bash :cmdline 1 2 3 printf "%s\n" "$1"

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Matt
On Fri, 17 Nov 2023 23:07:57 +0100 Matt wrote --- > The second claim has nothing to do with Org Babel. I was able to confirm it > and provide the steps to reproduce. I think it would make sense to report > it upstream and let them decide if it's expected behavior. I'm still

Re: [BUG] https://tracker.orgmode.org/ is down (error 502)

2023-11-18 Thread Bastien Guerry
Ihor Radchenko writes: > https://tracker.orgmode.org/ Is up again. > and https://updates.orgmode.org/ are > currently down, both returning 502. Is it necessary to bring updates.orgmode.org up? -- Bastien Guerry

[BUG] https://tracker.orgmode.org/ is down (error 502)

2023-11-18 Thread Ihor Radchenko
https://tracker.orgmode.org/ and https://updates.orgmode.org/ are currently down, both returning 502. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at

Re: Suggestion: User-contributed use-cases on orgmode.org ?

2023-11-18 Thread Ihor Radchenko
David Masterson writes: >> Would it help if we change it to >> >> It is made of numerous .org files from https://git.sr.ht/~bzg/worg. >> >> ? > > Perhaps: > > Follow the link https://git.sr.ht/~bzg/worg for information (including > cloning) on the WORG Git repository at SourceHut

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Ihor Radchenko
Matt writes: > Evaluating the following > > #+name: /tmp/test.sh > #+begin_src bash :results output > ssh localhost "echo foo>foo_file" > echo "bar" | tee /tmp/bar.txt > #+end_src > > does exactly what > > cat /tmp/test.sh | bash -c bash > > does. Both create a file "foo_file" containing

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Ihor Radchenko
Max Nikulin writes: > ... > I have not expected this difference. > > dash reads a block from stdin (whole file in this case) and interprets > commands. > > BASH reads just the ssh command and executes it. SSH reads "echo done" > from stdin, so when control is returned to bash, stdin is

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Ihor Radchenko
Bruno Barbier writes: >> WRT M-x shell, feel free to submit a bug report. I mostly pointed that >> the problem with M-x shell is not the problem you originally ran to. It >> is a different problem (also, we ran into it in the past). > > FWIW, M-x shell differs from what a plain terminal is doing

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Bruno Barbier
Matt writes: > On Sat, 18 Nov 2023 09:54:46 +0100 Bruno Barbier > > It's still not clear to me if this is "what Emacs does". However, that's the > best I could come up with. > > Evaluating the following > > #+name: /tmp/test.sh > #+begin_src bash :results output > ssh localhost

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Matt
On Sat, 18 Nov 2023 09:54:46 +0100 Bruno Barbier > But, you're right. To be safe, from now on, I'll use: > > cat /tmp/test.sh | bash -c bash It's still not clear to me if this is "what Emacs does". However, that's the best I could come up with. Evaluating the following

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Matt
To clarify a previous typo I made. Everything I've written was also done using: 1. emacs -q 2. C-x b "*scratch*" 3. M-x org-mode 4. Execute #+begin_src emacs-lisp :results none (org-babel-do-load-languages 'org-babel-load-languages '((shell . t))) #+end_src This corresponds to Org mode

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Bruno Barbier
Matt writes: > On Sat, 18 Nov 2023 09:29:56 +0100 Bruno Barbier > > > IIUC, what Max is saying is that you should not concentrate on > > *that specific command* because that command doesn't do what you think > > it does. > > Cool, it sounds like we're agreed (albeit for different

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Matt
On Sat, 18 Nov 2023 09:29:56 +0100 Bruno Barbier > IIUC, what Max is saying is that you should not concentrate on > *that specific command* because that command doesn't do what you think > it does. Cool, it sounds like we're agreed (albeit for different reasons). > To reproduce,

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Bruno Barbier
Max Nikulin writes: > On 25/10/2023 18:17, alain.coch...@unistra.fr wrote: >> By contrast, it works with this one: >> >> #+begin_src bash :results output >> sshcoch...@fruc.u-strasbg.fr "echo foo>foo_file" ; echo "bar" >> #+end_src > > What about > > #+begin_src bash :results

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Bruno Barbier
Matt writes: > On Sat, 18 Nov 2023 04:11:03 +0100 Max Nikulin wrote --- > > > > bash -c bash /tmp/two-lines.sh > > > > From my point of view it was a plain mistake in attempts to simulate > > the issue outside of Emacs. There is no point to concentrate on this > > command.

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Bruno Barbier
Hi Matt, Thanks this summary and for working on this! Just a few comments/corrections about some specific points, hoping it might help. Matt writes: > On Fri, 17 Nov 2023 10:20:28 +0100 Ihor Radchenko wrote --- > > > This has nothing to do with Emacs comint and this is also not a

Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands)

2023-11-18 Thread Matt
On Sat, 18 Nov 2023 04:11:03 +0100 Max Nikulin wrote --- > > bash -c bash /tmp/two-lines.sh > > From my point of view it was a plain mistake in attempts to simulate > the issue outside of Emacs. There is no point to concentrate on this > command. I tried to explain that

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Max Nikulin
On 25/10/2023 18:17, alain.coch...@unistra.fr wrote: By contrast, it works with this one: #+begin_src bash :results output sshcoch...@fruc.u-strasbg.fr "echo foo>foo_file" ; echo "bar" #+end_src What about #+begin_src bash :results output ssh coch...@fruc.u-strasbg.fr

Re: bash source code block: problem after ssh commands

2023-11-18 Thread Max Nikulin
On 17/11/2023 17:17, Ihor Radchenko wrote: I was only able to reproduce your problem with ssh asking a password. We are discussing the reproduced case. I see bash vs. dash difference with public key authorization, so no need for password prompts. I have not figured out how to construct an