Re: Is there a way to get the output of a function without an extra bash
From:
Eli Schwartz
Subject:
Re: Is there a way to get the output of a function without an extra bash process?
Date:
Sun, 10 May 2020 18:04:04 -0400
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0
On 5/10/20 5:53 PM, Peng Yu wrote:
>> Have you tried this:
>>
>> $ cat ./main2.sh
>> #!/usr/bin/env bash
>> # vim: set noexpandtab tabstop=2:
>>
>> set -v
>> echo "$BASHPID"
>> function f {
>> echo "$BASHPID"
>> }
>> f
>> $
>
> The output of f must be saved in a bash variable.
You've carefully avoided quoting the rest of my email, in which I
explained how to do this.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
signature.asc Description: OpenPGP digital signature