Re: some.. bug .. ?

2021-12-02 Thread Alex fxmbsw7 Ratchev
well no idea

printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile ; set -x ; .
afile 1 2 3 4 ; set +x
 + . afile 1 2 3 4
++ e=.
++ ((  4 > 1  ))
++ '' afile 1 2 3
   bash: : command not found
 + set +x

just as in my bashrc'd bashlink stuff, when its loaded it shows so and has
(had) the same error
again the workaround is eval "$e"

if u cant reproduce it, dunno what else than close it

On Wed, Dec 1, 2021, 08:01 Alex fxmbsw7 Ratchev  wrote:

> im not sure i understand
>
> this did happen on my bashlink project ( as bashrc etc ) and this example,
> but with --norc it works
>
> i dunno where to set -x
>
> changing $e to eval "$e" makes it work
> but weird that error appears
> i have no empty aliases i think
> also eval "$e" makes it work so, ..
>
> im sorry to not understand..
>
> i till i experienced --norc worked, thought, bash doesnt exexute . as var
> cause its a bash command, and eval is needed
> just on the second+ runs it showed this ( also the var wasnt empty , .. )
>
> sorry again for your efforts
>
> ill try set -x on this piece of code but i dont expect any results
>
>
> On Wed, Dec 1, 2021, 05:30 Dale R. Worley  wrote:
>
>> Alex fxmbsw7 Ratchev  writes:
>> > printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile ; . afile
>> 1 2
>> > 3
>> >
>> > bash: : command not found
>>
>> This looks like another instance where you've constructed a command
>> whose first word is the empty word.  Try running with "set -x" and see
>> what the command lines are when they're expanded.
>>
>> Dale
>>
>


Re: some.. bug .. ?

2021-12-02 Thread Greg Wooledge
On Thu, Dec 02, 2021 at 05:44:14PM +0100, Alex fxmbsw7 Ratchev wrote:
> well no idea
> 
> printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile ; set -x ; .
> afile 1 2 3 4 ; set +x
>  + . afile 1 2 3 4
> ++ e=.
> ++ ((  4 > 1  ))
> ++ '' afile 1 2 3
>bash: : command not found
>  + set +x

I can't reproduce this in bash 5.1.

unicorn:/tmp/x$ printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile
unicorn:/tmp/x$ set -x
unicorn:/tmp/x$ . afile 1 2 3 4
+ . afile 1 2 3 4
++ e=.
++ ((  4 > 1  ))
++ . afile 1 2 3
+++ e=.
+++ ((  3 > 1  ))
+++ . afile 1 2
 e=.
 ((  2 > 1  ))
 . afile 1
+ e=.
+ ((  1 > 1  ))
unicorn:/tmp/x$ echo "$BASH_VERSION"
+ echo '5.1.4(1)-release'
5.1.4(1)-release



Re: some.. bug .. ?

2021-12-02 Thread Alex fxmbsw7 Ratchev
yea suxx

ill recode the bashlink somewhen and see then

On Thu, Dec 2, 2021, 17:56 Greg Wooledge  wrote:

> On Thu, Dec 02, 2021 at 05:44:14PM +0100, Alex fxmbsw7 Ratchev wrote:
> > well no idea
> >
> > printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"' >afile ; set -x ;
> .
> > afile 1 2 3 4 ; set +x
> >  + . afile 1 2 3 4
> > ++ e=.
> > ++ ((  4 > 1  ))
> > ++ '' afile 1 2 3
> >bash: : command not found
> >  + set +x
>
> I can't reproduce this in bash 5.1.
>
> unicorn:/tmp/x$ printf 'e=. ; (( $# > 1 )) && $e afile "${@:1:$# -1}"'
> >afile
> unicorn:/tmp/x$ set -x
> unicorn:/tmp/x$ . afile 1 2 3 4
> + . afile 1 2 3 4
> ++ e=.
> ++ ((  4 > 1  ))
> ++ . afile 1 2 3
> +++ e=.
> +++ ((  3 > 1  ))
> +++ . afile 1 2
>  e=.
>  ((  2 > 1  ))
>  . afile 1
> + e=.
> + ((  1 > 1  ))
> unicorn:/tmp/x$ echo "$BASH_VERSION"
> + echo '5.1.4(1)-release'
> 5.1.4(1)-release
>
>