emacs-orgmode
[Top][All Lists]
Advanced

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

Re: bash source code block: problem after ssh commands


From: Max Nikulin
Subject: Re: bash source code block: problem after ssh commands
Date: Thu, 23 Nov 2023 00:06:55 +0700
User-agent: Mozilla Thunderbird

On 22/11/2023 02:01, Bruno Barbier wrote:
Ihor Radchenko writes:
__By default__, Org should produce more expected behavior - what users
would get from running a script file rather than from redirecting stdin.
We can optionally leave the stdin redirection as an option to be used by
the users who understand the peculiarities.

I agree that it would be simpler to switch to the script-like behavior
by default on org side.  About the interactive-like behavior, that
would be nice to keep it, if some people rely on it in their existing
documents (I personally don't).

I do not like recommendations

    curl https://... | sudo bash

but I regularly see them. So some users might expect behavior like namely stdin, not like interactive prompt commands.

Perhaps even sessions may be switched to creation of a temporary file and executing "source tmpfile.sh". However it may be shell-specific (posh?).

Likely it is possible to implement a header argument to explicitly control whether `process-file' should be used or the block should be executed as a temporary script file. Currently it is implicitly determined from other header arguments.

P.S.

https://mywiki.wooledge.org/BashFAQ/089
"I'm reading a file line by line and running ssh or ffmpeg, only the first line gets processed!"

A similar case, but only data is read from stdin, script is a regular file, no difference bash vs. dash.




reply via email to

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