help-bash
[Top][All Lists]
Advanced

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

Re: some.. bug .. ?


From: Alex fxmbsw7 Ratchev
Subject: Re: some.. bug .. ?
Date: Thu, 2 Dec 2021 17:44:14 +0100

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 <fxmbsw7@gmail.com> 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 <worley@alum.mit.edu> wrote:
>
>> Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> 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
>>
>


reply via email to

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