[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
- Bug or not a bug? dot expansion in ob-shell, Vladimir Nikishkin, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Fraga, Eric, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Fraga, Eric, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell,
Bastien <=
- Re: Bug or not a bug? dot expansion in ob-shell, Fraga, Eric, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Vladimir Nikishkin, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Kaushal Modi, 2020/02/27
- Re: Bug or not a bug? dot expansion in ob-shell, Tim Cross, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Tim Cross, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Bastien, 2020/02/19
- Re: Bug or not a bug? dot expansion in ob-shell, Fraga, Eric, 2020/02/19