From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Nikishkin Subject: Re: Bug or not a bug? dot expansion in ob-shell Date: Wed, 19 Feb 2020 20:06:40 +0800 Message-ID: References: <87eeur3p1p.fsf@ucl.ac.uk> <87a75eap8k.fsf@gnu.org> <87y2sy3kkl.fsf@ucl.ac.uk> <87r1yq4xiz.fsf@gnu.org> <875zg2kcy0.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b304b8059eec9f26" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51144) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4O80-0006mU-F8 for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 07:06:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4O7z-0004Mt-9U for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 07:06:56 -0500 In-Reply-To: <875zg2kcy0.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: "Fraga, Eric" Cc: Bastien , "emacs-orgmode@gnu.org" --000000000000b304b8059eec9f26 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That's an excellent response, Eric! Now what about this block: #+begin_src shell printf "%s" ' (computer . ?type) exit' #+end_src =D1=81=D1=80, 19 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3. =D0=B2 19:56, Fraga= , Eric : > 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 =3Dreturn=3D > 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 > --=20 Yours sincerely, Vladimir Nikishkin --000000000000b304b8059eec9f26 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That's an excellent response, Eric!
Now what about this block:

#+begin_src= shell
=C2=A0 printf "%s" '
=C2=A0 (computer . ?type)=C2=A0 exit'
#+end_src

=D1=81=D1=80, 19 =D1=84=D0=B5=D0= =B2=D1=80. 2020 =D0=B3. =D0=B2 19:56, Fraga, Eric <e.fraga@ucl.ac.uk>:
On Wednesday, 19 Feb 2020 at 12:38, Bastien wrot= e:
> "0" is the _exit code_ of the successful echo command, not t= he value
> returned by the echo command.

But echo does not "return" the string as a value.=C2=A0 It output= s the
string.

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

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

I disagree.=C2=A0 I think the current behaviour (i.e. before your attempt t= o
"correct"" this) is correct given the documentation you quot= ed!

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

Common?=C2=A0 I have no idea.=C2=A0 *I* did expect this.=C2=A0 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.=C2=A0 The option to request the output as the outcome of the sr= c
block is already there.
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-345-g415083


--
Yours sincerely, Vladimir Nikishkin

--000000000000b304b8059eec9f26--