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: Bastien
Subject: Re: Bug or not a bug? dot expansion in ob-shell
Date: Wed, 19 Feb 2020 12:38:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Eric,

"Fraga, Eric" <address@hidden> writes:

> On Wednesday, 19 Feb 2020 at 10:41, Bastien wrote:
>> It returned "0" for me, while I guess "." is expected.
>
> I expected 0 as that is the "value" (i.e. the status in a shell) of
> the last command.

Quoting the manual:

‘value’
     Default.  Functional mode.  Org gets the value by wrapping the code
     in a function definition in the language of the source block.  That
     is why when using ‘:results value’, code should execute like a
     function and return a value.  For languages like Python, an
     explicit ‘return’ statement is mandatory when using ‘:results
     value’.  Result is the value returned by the last statement in the
     code block.

"0" is the _exit code_ of the successful echo command, not the value
returned by the echo command.

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

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

-- 
 Bastien



reply via email to

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