bug-bash
[Top][All Lists]
Advanced

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

Re:


From: Budi
Subject: Re:
Date: Mon, 22 Mar 2021 14:25:31 +0000

On 3/22/21, Greg Wooledge <greg@wooledge.org> wrote:
> On Mon, Mar 22, 2021 at 09:50:06AM +0000, Budi wrote:
>> in a function k() in  ~/.bashrc
>>
>> k(){ unset u;h=0; o=(${h:+ ! -path "./*.txt"}) ;u=($u "${o[@]}"); c=(.
>> -regextype posix-extended "${b[@]}" -print); find "${c[@]}"
>>  }
>>
>> in output set -x:
>>
>> + unset u
>> + h-0
>
> This is clearly a falsehood.  You didn't paste the actual output.
>
>> + o=(${h:+ ! -path "./*.txt"})
>> + u=($u "${o[@]}")
>
> Why have the unquoted $u here when you know the variable is unset?
>
>> + c=(. -regextype posix-extended "${b[@]}" -print)
>
> What's in the array "b"?  You never showed any such array.
>
>> + find . -regextype posix-extended ' ! -path ./*.txt' -print
>> find: paths must precede expression: ` ! -path ./*.txt'
>>
>> Why and how to solve ?
>
> I think your real question is this one -- why did the exclamation point
> and the word -path and the word ./*.txt all get squashed together into
> a single word, instead of being inserted as three separate words?
>
> If you can simplify your code down to *just* that case, and if you can
> show an actual reproducer for it, then we might try to reproduce it
> ourselves.
>
> As it is now, I don't trust what you've written here, because you clearly
> haven't been honest about it, and you haven't shown the actual commands
> you ran ("set -x output" of what??), let alone the actual output.
>

You're absolutely precisely correct!
messed up the real case with the transformed code one as it's in
hurry, here fixed simplified one:

unset b;u=7; o=(${u+ ! -path "./*.txt"}) ;b=($b "${o[@]}"); c=(.
-regextype posix-extended "${b[@]}" -print); find "${c[@]}"

absolutely work..
when deployed in a function in ~/.bashrc it failed as said
so confusing why, what the glitch causing it



reply via email to

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