help-bash
[Top][All Lists]
Advanced

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

Re: condition to execute


From: Eli Schwartz
Subject: Re: condition to execute
Date: Tue, 6 Jul 2021 18:06:57 -0400

On 7/6/21 5:41 PM, lisa-asket@perso.be wrote:
> In elisp, I can return an object from a function using the last command in 
> the function.
> Does this not apply to bash functions as well?  Should all bash functions only
> return a proper exit status and nothing else?


In bash, you cannot return anything from a function other than the
integer error code.

You *also* have access to the function's stdout which may be used as IPC
to send text streams. I suppose you could send elisp objects too, but
the function would need to know how to create and serialize those
objects as... a text stream. And then after capturing that into a
variable, you'd need to pass your text encoded elisp object
serialization to a function that knows how to decode and interpret it.

But the stdout IPC mechanism is not a "return value".


-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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