On 3/20/22 5:05 PM, Alexey via Bug reports for the GNU Bourne Again SHell
wrote:
Bash Version: 5.1
Patch Level: 16
Release Status: release
Description:
If use 'Parameter Expansion', for example 'Remove matching suffix
pattern', on array and try to iterate over expansion result with for loo
On Tue, Mar 22, 2022, at 11:05 PM, L A Walsh wrote:
> On 2022/03/22 14:04, Lawrence Velázquez wrote:
>> On Tue, Mar 22, 2022, at 4:53 PM, L A Walsh wrote:
>>
>>> On 2022/03/21 03:40, Alex fxmbsw7 Ratchev wrote:
>>>
i solve this by shopt -s nullglob
> Repeat-By:
On Tue, Mar 22, 2022 at 08:05:21PM -0700, L A Walsh wrote:
> > > > > Repeat-By:
> > > > >Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
> > > > >Result: none
> > > > >Expected result: i is ''
> Sorry, I got sidetracked. In this case it wouldn't matter,
> if you have n
On 2022/03/22 14:04, Lawrence Velázquez wrote:
On Tue, Mar 22, 2022, at 4:53 PM, L A Walsh wrote:
On 2022/03/21 03:40, Alex fxmbsw7 Ratchev wrote:
i solve this by shopt -s nullglob
Repeat-By:
Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
Result: none
On 2022/03/22 13:53, L A Walsh wrote:
On 2022/03/21 03:40, Alex fxmbsw7 Ratchev wrote:
i solve this by shopt -s nullglob
Repeat-By:
Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
Result: none
Expected result: i is ''
BTW -- try adding "-u" on your bas
On Tue, Mar 22, 2022, at 4:53 PM, L A Walsh wrote:
> On 2022/03/21 03:40, Alex fxmbsw7 Ratchev wrote:
>> i solve this by shopt -s nullglob
>>
>>>
>>> Repeat-By:
>>>Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
>>>Result: none
>>>Expected result: i is ''
>>>
> if
On 2022/03/21 03:40, Alex fxmbsw7 Ratchev wrote:
i solve this by shopt -s nullglob
Repeat-By:
Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
Result: none
Expected result: i is ''
if you have nullglob set, then that is not the correct result.
I used:
#!/bin/bas
On Mon, Mar 21, 2022 at 02:47:12PM -0400, Lawrence Velázquez wrote:
> On Mon, Mar 21, 2022, at 8:50 AM, Alexey via Bug reports for the GNU Bourne
> Again SHell wrote:
> > I can add one more example, which change array size while it's not
> > expected behavior:
> > x=("/"); y=("${x[@]%/}"); echo "
On Mon, Mar 21, 2022, at 8:50 AM, Alexey via Bug reports for the GNU Bourne
Again SHell wrote:
> I can add one more example, which change array size while it's not
> expected behavior:
> x=("/"); y=("${x[@]%/}"); echo "x size: ${#x[@]}, y size: ${#y[@]}"
This discrepancy seems to have been intro
I can add one more example, which change array size while it's not
expected behavior:
x=("/"); y=("${x[@]%/}"); echo "x size: ${#x[@]}, y size: ${#y[@]}"
Goal of this example show that it is not only for loop issue.
Stop. Posting. Upside-down.
> > On Sun, Mar 20, 2022, 22:07 Alexey via Bug reports for the GNU Bourne
> > > Repeat-By:
> > > Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
> > > Result: none
> > > Expected result: i is ''
> On 2022-03-21 14:40, Alex fxmbsw7 Ratchev wrote:
> > i
nullglob is not applicable in this situation, because no 'Pathname
Expansion' is occur.
On 2022-03-21 14:40, Alex fxmbsw7 Ratchev wrote:
i solve this by shopt -s nullglob
On Sun, Mar 20, 2022, 22:07 Alexey via Bug reports for the GNU Bourne
Again SHell wrote:
Hello.
Machine: x86_64
i solve this by shopt -s nullglob
On Sun, Mar 20, 2022, 22:07 Alexey via Bug reports for the GNU Bourne Again
SHell wrote:
> Hello.
>
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat
> -Werror=format-security -Wall
> uname output: L
13 matches
Mail list logo