[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unset array doesn't work
From: |
Nikolai Kondrashov |
Subject: |
Re: Unset array doesn't work |
Date: |
Mon, 12 Feb 2018 09:23:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 02/12/2018 09:06 AM, Clark Wang wrote:
On Mon, Feb 12, 2018 at 2:45 PM, Nikolai Kondrashov <spbnick@gmail.com
<mailto:spbnick@gmail.com>> wrote:
On 02/12/2018 08:41 AM, Nikolai Kondrashov wrote:
inner() {
unset res
Oh, and duplicating this line fixes the issue.
Take a look at these links:
- http://wiki.bash-hackers.org/commands/builtin/unset
- http://www.fvue.nl/wiki/Bash:_Passing_variables_by_reference
Thanks, Clark! However, I find it difficult to follow the explanation at the
first link and even more difficult to connect it to this case. So I'm not sure
I'm getting it right. Could you maybe explain what exactly happens in the code
I posted?
Regarding the second link, yeah I can see a few ways that the code in question
could be improved regarding passing the values from the function, but it's not
my code, so I wouldn't like to push for a change unless the problem is indeed
with the code and not with Bash.
Thank you.
Nick
- Unset array doesn't work, Nikolai Kondrashov, 2018/02/11
- Re: Unset array doesn't work, Chet Ramey, 2018/02/12
- Re: Unset array doesn't work, Nikolai Kondrashov, 2018/02/12
- Re: Unset array doesn't work, Robert Elz, 2018/02/26
- Re: Unset array doesn't work, Clint Hepner, 2018/02/26
- Re: Unset array doesn't work, Greg Wooledge, 2018/02/26
- Re: Unset array doesn't work, Clark Wang, 2018/02/26
- Re: Unset array doesn't work, Robert Elz, 2018/02/26
- Re: Unset array doesn't work, Chet Ramey, 2018/02/27