Re: bash source code block: problem after ssh commands
Hi, alain.coch...@unistra.fr writes: > Ihor Radchenko writes on Thu 26 Oct 2023 13:44: > > > I can now reproduce the problem locally. > > > > It boils down to > > > > (setq exit-status > > (process-file shell-file-name input-file > >(if error-file > >(list t error-file) > > t) > >nil shell-command-switch command)) > > > > that is an equivalent of > > > > bash -c bash /path/to/file-containing-the-source-code.sh > > ... > I am confused about what you specifically do to "evaluate the above". > To start with, I have to use quotes to make your command be performed: > >bash -c "bash /path/to/file-containing-the-source-code.sh" > ... > > But most importantly, the second line *is* produced, either if I use > an SSH key for passwordless access or if I enter the password > manually. IIUC, the elisp expression: (process-file "bash" "/tmp/test.sh") is more equivalent to: cat /tmp/test.sh | bash i.e. the shell is getting the commands from stdin. Thus, any command that uses stdin might change what gets executed or not. I'm able to reproduce using the following minimal script, without passwords nor SSH (where the cryptic first line closes stdin). #+begin_src shell :results output exec 0>&- echo OK #+end_src The result is "OK" only when commenting out the first line; else, the echo command is not executed (because stdin has been closed). Here is an other example, where the second echo is eaten by the script itself: #+begin_src shell :results output echo 1 read -p "Next command? " NEXT_COMMAND echo 2 echo 3 #+end_src #+RESULTS: : 1 : 3 Bruno
Preferred posting style
Hello, Which posting style is preferable in this list? Top or Bottom. -- (yaxp me) => t
[PATCH] Fix warning about using `eq' to compare strings.
Hi, everyone. Small fix attached -- it just makes a warning go away. Best regards, -Karl >From a1a939191af1a195f260037510d407e7483ba05f Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Mon, 30 Oct 2023 10:33:29 -0500 Subject: [PATCH] lisp/org-table.el: fix warning about `eq' usage * lisp/org-table.el (org-table-make-reference): Use `equal' instead of `eq' to compare strings. This change makes the following warning go away: Warning (comp): org-table.el:2867:23: \ Warning: `eq' called with literal string that may never match (arg 2) This change does not affect the behavior of `org-table-make-reference' because `eq' treats all instances of the empty string as the same object anyway, e.g., `(eq (string-trim "aaabbb" "a+" "b+") "")' ==> t. The only effect of this change is to eliminate the warning. --- lisp/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index f5a433c7d..860d7720d 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2864,7 +2864,7 @@ list, `literal' is for the format specifier L." (if lispp (if (eq lispp 'literal) elements - (if (and (eq elements "") (not keep-empty)) + (if (and (equal elements "") (not keep-empty)) "" (prin1-to-string (if numbers (string-to-number elements) elements -- 2.42.0
Re: Preferred posting style
On Monday, 30 Oct 2023 at 21:25, yaxp wrote: > Which posting style is preferable in this list? > > Top or Bottom. Bottom, definitely. (at least, from my point of view) Thank you. -- : Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50