emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Bug or not a bug? dot expansion in ob-shell


From: Fraga, Eric
Subject: Re: Bug or not a bug? dot expansion in ob-shell
Date: Wed, 19 Feb 2020 11:56:40 +0000

On Wednesday, 19 Feb 2020 at 12:38, Bastien wrote:
> "0" is the _exit code_ of the successful echo command, not the value
> returned by the echo command.

But echo does not "return" the string as a value.  It outputs the
string.

To quote the man page for bash, "the return value of a simple command is
its status".  Further, a function does not actually return any value
beyond the status of the last command or a value given on a =return=
statement.

> So In Vladimir's example, both ":results value" and ":results output"
> should return the same result, i.e. ".".

I disagree.  I think the current behaviour (i.e. before your attempt to
"correct"" this) is correct given the documentation you quoted!

> Was it common to expect the exit code when executing shell code?

Common?  I have no idea.  *I* did expect this.  But that's maybe because
I do use the shell a lot.

I think there's a clear distinction between value and output for src
blocks and blurring this distinction for shell src blocks would be
misleading.  The option to request the output as the outcome of the src
block is already there.
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-345-g415083



reply via email to

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