bug-bash
[Top][All Lists]
Advanced

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

Re: another bug with the alias bug style but for . source .. ?


From: Alex fxmbsw7 Ratchev
Subject: Re: another bug with the alias bug style but for . source .. ?
Date: Sun, 29 Nov 2020 11:23:39 +0100

( http://ix.io/2FTF )

contra report, but as i write inside i cant reproduce via simple code, only
like before pasted workcodes

   ++ BEGINFILE i.bugfree

unlike shown in my first post this works bug freely
but the first post remains, the code is there, it doesnt work, sad noone replied

if it was unclear: i set array to content, source file, works, then
again it doesnt, the old values remained active not the new ones

i also cant demo case the alias problem with unexpected token
<whatsoever> cause i try and it works, but then i write real code and
in that [ i pasted ] it didnt work , ...

/xmb

   -- ENDFILE i.bugfree   -=| 447 chars 87 words 8 lines
   ++ BEGINFILE 2.bugfree

++ arr=(1 2)
++ . bug
+++ i=-1
+++ [[ -v arr[++i] ]]
+++ : 0==1
+++ [[ -v arr[++i] ]]
+++ : 1==2
+++ [[ -v arr[++i] ]]
++ arr=(3 4)
++ . bug
+++ i=-1
+++ [[ -v arr[++i] ]]
+++ : 0==3
+++ [[ -v arr[++i] ]]
+++ : 1==4
+++ [[ -v arr[++i] ]]
++ set +x

   -- ENDFILE 2.bugfree   -=| 248 chars 61 words 17 lines
   ++ BEGINFILE bugfree.sourceme

set -x
arr=( 1 2 )
. bugfree
arr=( 3 4 )
. bugfree
set +x

   -- ENDFILE bugfree.sourceme   -=| 58 chars 16 words 6 lines
   ++ BEGINFILE bugfree

i=-1
while [[ -v arr[++i] ]]; do
 : "$i==${arr[i]}"
done

   -- ENDFILE bugfree   -=| 57 chars 10 words 4 lines
   -- END of 4 pastes ( 810 chars 174 words 35 lines


On Sat, Nov 21, 2020, 23:35 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> wrote:

> ( same text as http://ix.io/2F0B )
>
> im over this bug while i got errors from aliases, now tried . source but
> .. here another bug ?
>
>
>    ++ BEGINFILE ../ii.x7yz.source-err
>
> i source there the init script
> then it runs, and for the first part it works, but on the second with aixz= 
> .. non existing .. it runs just as it wasnt set at all
> (
> ++ alxz=("$x7yzd"/asdd)
> ++ . -- /root/x7yzd/+ixz
> +++ aixzi=-1
> +++ [[ -v aixz[++aixzi] ]]
> +++ aixzf=/root/x7yzd/+ixz
> )
> by initial:
> (
> ++ aixz=("$x7yzd"/+{ixz,kw})
> ++ . -- /root/x7yzd/+ixz
> +++ aixzi=-1
> +++ [[ -v aixz[++aixzi] ]]
> )
>
> this bug i discovered while trying to workaround the alias bugs that make 
> unknown token ';' or && or ( appear
>
> in the x7yz init code i've initially tried as second run aixz=( 
> "$x7yzd"/!(+@(ixz|kw)) ) and use +ixz alias, but as it returned same behavior 
> as i posted above i tried it so, and still failed
> additional files than the two in question by request
>
> hope for help
>
> thank you // xmb
>
> -- sorry to explain the thing to you, shortened coding, ./x7yz is the init 
> script, +ixz adds by 'ixz' structure aliases or keywords ( kw keyword array 
> system, .. another paste .. )
>
>
> root@boost:~/x7yzd# . x7yz
> + . x7yz
> ++ x7yz=x7yz
> ++ x7yz=/root/x7yzd/x7yz
> ++ x7yz=/root/x7yzd/x7yz
> ++ x7yzd=/root/x7yzd
> ++ shopt -s extglob globstar expand_aliases
> ++ aixz=("$x7yzd"/+{ixz,kw})
> ++ . -- /root/x7yzd/+ixz
> +++ aixzi=-1
> +++ [[ -v aixz[++aixzi] ]]
> +++ aixzf=/root/x7yzd/+ixz
> +++ aixzn=+ixz
> +++ [[ -e /root/x7yzd/+ixz ]]
> +++ [[ +ixz == *, ]]
> +++ [[ -d /root/x7yzd/+ixz ]]
> +++ [[ +ixz == *. ]]
> +++ [[ /root/x7yzd/+ixz == *= ]]
> +++ [[ -f /root/x7yzd/+ixz= ]]
> +++ alias -- '+ixz=
> . -- '\''/root/x7yzd/+ixz'\''
>  '
> +++ [[ -v aixz[++aixzi] ]]
> +++ aixzf=/root/x7yzd/+kw
> +++ aixzn=+kw
> +++ [[ -e /root/x7yzd/+kw ]]
> +++ [[ +kw == *, ]]
> +++ [[ -d /root/x7yzd/+kw ]]
> +++ [[ +kw == *. ]]
> +++ [[ /root/x7yzd/+kw == *= ]]
> +++ [[ -f /root/x7yzd/+kw= ]]
> +++ alias -- '+kw=
> . -- '\''/root/x7yzd/+kw'\''
>  '
> +++ [[ -v aixz[++aixzi] ]]
> ++ alxz=("$x7yzd"/asdd)
> ++ . -- /root/x7yzd/+ixz
> +++ aixzi=-1
> +++ [[ -v aixz[++aixzi] ]]
> +++ aixzf=/root/x7yzd/+ixz
> +++ aixzn=+ixz
> +++ [[ -e /root/x7yzd/+ixz ]]
> +++ [[ +ixz == *, ]]
> +++ [[ -d /root/x7yzd/+ixz ]]
> +++ [[ +ixz == *. ]]
> +++ [[ /root/x7yzd/+ixz == *= ]]
> +++ [[ -f /root/x7yzd/+ixz= ]]
> +++ alias -- '+ixz=
> . -- '\''/root/x7yzd/+ixz'\''
>  '
> +++ [[ -v aixz[++aixzi] ]]
> +++ aixzf=/root/x7yzd/+kw
> +++ aixzn=+kw
> +++ [[ -e /root/x7yzd/+kw ]]
> +++ [[ +kw == *, ]]
> +++ [[ -d /root/x7yzd/+kw ]]
> +++ [[ +kw == *. ]]
> +++ [[ /root/x7yzd/+kw == *= ]]
> +++ [[ -f /root/x7yzd/+kw= ]]
> +++ alias -- '+kw=
> . -- '\''/root/x7yzd/+kw'\''
>  '
> +++ [[ -v aixz[++aixzi] ]]
> ++ KWS
> bash: KWS: command not found
> root@boost:~/x7yzd#
>
>    -- ENDFILE ../ii.x7yz.source-err   -=| 2502 chars 428 words 95 lines
>    ++ BEGINFILE x7yz
>
> #!/bin/bash --init-file
>
> x7yz=${BASH_SOURCE##/*} x7yz=${x7yz:+$PWD/$x7yz} x7yz=${x7yz:-$BASH_SOURCE} 
> x7yzd=${x7yz%/*}
>
> shopt -s extglob globstar expand_aliases
>
> aixz=( "$x7yzd"/+{ixz,kw} )
> . -- "$aixz"
> alxz=( "$x7yzd"/asdd )
> . -- "$x7yzd"/+ixz
>
> KWS
>
>    -- ENDFILE x7yz   -=| 249 chars 24 words 12 lines
>    ++ BEGINFILE +ixz
>
> aixzi=-1
> while [[ -v aixz[++aixzi] ]]
> do aixzf=${aixz[aixzi]} aixzn=${aixzf##*/}
>  if ! [[ -e $aixzf ]]
>  then continue
>  fi
>
>  if [[ $aixzn == *, ]]
>  then continue
>  fi
>
>  if [[ -d $aixzf ]]
>  then aixz+=( "$aixzf"/* )
>   continue
>  fi
>
>  if [[ $aixzn == *. ]]
>  then aixzn=${aixzn%.}
>   if [[ $aixzn == *. ]]
>   then continue
>   fi
>   if [[ -f $aixzf. ]]
>   then akwt=$( < "$aixzf". )
>   else akwt=0
>   fi
>   if [[ -f $aixzf.. ]]
>   then mapfile -d '' -t akw <"$aixzf"..
>   else akw=( "$aixzn" )
>   fi
>
>   akwc=$( < "$aixzf" ) +kw
>  else
>
>   if [[ $aixzf == *= ]]
>   then continue
>   fi
>
>   if [[ -f $aixzf= ]]
>   then alias -- "$( < "$aixzf"= )"=$'\n. -- '"${aixzf@Q}"$'\n '
>   else alias -- "$aixzn="$'\n. -- '"${aixzf@Q}"$'\n '
>   fi
>  fi
> done
>
>
>
>    -- ENDFILE +ixz   -=| 721 chars 125 words 45 lines
>    -- END of 3 pastes ( 3472 chars 577 words 152 lines
>
>


reply via email to

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