[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Adding missing bash features for safely re-usable bash c
From: |
adrelanos |
Subject: |
Re: [Help-bash] Adding missing bash features for safely re-usable bash code |
Date: |
Mon, 08 Apr 2013 17:51:01 +0000 |
DJ Mills:
> On Mon, Apr 8, 2013 at 11:52 AM, adrelanos <address@hidden>
> wrote:
>
>> I miss a feature to return non-integers from bash functions, i.e.
>> to return strings from bash functions.
>>
>> my_bash_function() { return "some_string" }
>>
>> string="`my_bash_function`"
>>
>> There are workarounds, yes, but nothing as simple as the one
>> liner.
>>
>>
> ''return'' is like ''exit'' for functions, think of it as exit
> status. What you gave doesn't capture that... func() { echo
> "some_string" }
>
> string=$(func)
This only works if the echo is the end of the function. What about
functions which are supposed to return different strings depending on
if/else?
- Re: [Help-bash] starting a central bash script repository, (continued)
Re: [Help-bash] starting a central bash script repository, Pierre Gaston, 2013/04/08
- [Help-bash] Adding missing bash features for safely re-usable bash code, adrelanos, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Greg Wooledge, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, adrelanos, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, DJ Mills, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code,
adrelanos <=
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Greg Wooledge, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Eric Blake, 2013/04/08
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Pierre Gaston, 2013/04/09
- Re: [Help-bash] Adding missing bash features for safely re-usable bash code, John Kearney, 2013/04/09
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, adrelanos, 2013/04/08
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Greg Wooledge, 2013/04/08
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, John Kearney, 2013/04/08
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Greg Wooledge, 2013/04/09
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, Pierre Gaston, 2013/04/08
Re: [Help-bash] Adding missing bash features for safely re-usable bash code, adrelanos, 2013/04/08