[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a few bugs, i hope you can read it
From: |
Alex fxmbsw7 Ratchev |
Subject: |
a few bugs, i hope you can read it |
Date: |
Mon, 1 Feb 2021 03:26:20 +0100 |
( http://ix.io/2NUp ) - sadly i dont have the depaster ready, some loop
deep logic faukts
bash-5.1# n=1 bash paster $( < thefiles )
++ paste BEGIN ++
++ paste BEGINFILE theintro
hello to this bug report, consisted as one big text file of pastes of
contents of files, with the code of 'depaste' back together-able
the tree ( ~/ixz/ ) is for short codings, it consists of the code files
with the bugs or fixed however outpointed topics by 'bug.' or 'success.'
name containing files
to explain the ixz codes, ixz, short x, long story, .. is now current name
here to short codibgs
aixz == add_ixz
an ixz is either a code file to be bound as alias ( the content of the file
as alias ) or marked for code eval later as keywords in associative arrays
./+ixz == addment of the files / dirs
./+kw == addment of keywords
./KWS == init KWS array
./ixz == the main init script to run or source
serval '.' '..' ~ and = marked helper or config files also
please let me know how you found that multiline paste
++ paste ENDFILE theintro ( 18 lined 158 worded 806 chared )
++ paste BEGINFILE thebugs
the bugs i came across affect the reuse code system of bash, i havent
looked at any .c sources much cause thatd be poitless as with my not
knowing of .c
so i invented simply ( in the sake of public domain open source better-up
systems ) singular short code files for parts of the acting of a script \
system .. then using em inside shortly also and voila , perfect code would
be
.. nearly was so, bash bugs came across
it came first with some here not documented 'unexpected token: <..>' errors
when aliasing conplex code
then now one hangs bash, before it didnt ( on initial 5 releases ) but it
didnt work i just say here it hangs bash till c-c
the others are
i set aixz=( .. .. ) and then source a file that binds them to aliases or
keywords, and as second i do redefine aixz=( <other_value> ) and that other
value is just not.. the older two values it ran with, no idea ..
i had only once success, with an invalid combination like 'source all files
in the right order manually written' instead of with a second run, that
failed due to save bugs
..
bug.varnotnewalias bug.varnotnewalias.2 bug.varnotnewstillalias
bug.hangalias
++ paste ENDFILE thebugs ( 17 lined 209 worded 1119 chared )
++ paste BEGINFILE thefiles
theintro thebugs thefiles
if.bash.correctly.updated
paster
bug.varnotnewalias ixz.bug.varnotnewalias ixz.bug.varnotnewalias.o
bug.varnotnewalias.2 ixz.bug.varnotnewalias.2 ixz.bug.varnotnewalias.2.o
bug.varnotnewstillalias ixz.bug.varnotnewstillalias
ixz.bug.varnotnewstillalias.o
bug.hangalias ixz.bug.hangalias ixz.bug.hangalias.o
success.KWSran ixz.success.KWSran ixz.success.KWSran.o
featurereq.recursivealiases
bug.newaliasesnotavailabletillnewline
bug.aliasnotavailable
ixz
+ixz
+kw
KWS
IA.
IA..
IA=.
IA=..
IA~.
IA~..
ekw
ifkwe
ifkweo
kweval
kwp
++ paste ENDFILE thefiles ( 33 lined 38 worded 526 chared )
++ paste BEGINFILE if.bash.correctly.updated
i downloaded the you said and commented first the two ifs and endifs then
uncommented and changed 0 to 1, still no bug fixed, at least of my current
tree
i built using ./configure ; make -j 8 ; make install ; mv
/bin/bash{,.old..} ; cp /usr/local/bin/bash /bin
it says :
bash-5.1# bash --version
GNU bash, version 5.1.4(1)-maint (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
hope thats correct
++ paste ENDFILE if.bash.correctly.updated ( 14 lined 100 worded 609 chared
)
++ paste BEGINFILE paster
#!/bin/bash
#shopt -s expand_aliases
{ paster=$( < /dev/fd/0 )
} <<'eo'
#!/usr/bin/gawk -f
# paste multiple files to one flat text file
BEGIN { ORS = OFS = "" ; dis[""] dis[0] dis["off"] dis["dis"]
dis["disable"] dis["disabled"] }
function header() { if ( ! ( n in dis ) ) print "++ paste BEGINFILE "
FILENAME " \0\n\n" }
function footer() { if ( ! ( n in dis ) ) print "\n\n++ paste ENDFILE "
FILENAME " \0( " statf() " )\n\n" }
function statf() { wl += FNR ; return FNR " lined " w " worded " c "
chared" }
END { if ( ! ( n in dis ) ) print "++ paste END ++ " file " files " wl "
lines " ww " words " wc " chars\n\n" }
BEGINFILE { ++file ; header() }
ENDFILE { footer(); ww += w ; wc += c ; w = c = 0 }
BEGIN { if ( ! ( n in dis ) ) print "++ paste BEGIN ++\n\n" }
{
w += NF ; c += length()
print $0 RT ; fflush()
}
eo
{
if [[ -v p ]]
then case "$p" in
ix*) curl -F 'f:1=<-' ix.io ;;
0x0*) .. ;;
*) cat ;; #>>"${o:=/tmp/${RANDOM:0:3}${RANDOM:0:3}}" ;;
esac
else cat
fi
} < <(
for arg
do [[ ! -e $arg ]] && continue
if [[ -d $arg ]]
then args+=( "$arg"/** )
else args+=( "$arg" )
fi
done
gawk -v n="$n" -e "$paster" -- "${args[@]}" )
++ paste ENDFILE paster ( 48 lined 255 worded 1126 chared )
++ paste BEGINFILE bug.varnotnewalias
here i set for the initial loader to make out of "$ixzd" ( the current
script dir ) aixz=( "$ixzd"/+{ixz,kw} ) ( add ixz .. short alias system, x
ixz ikhxcsz ( 7y ) ..
and that works, as i can use the +ixz alias for this further later
however, on the second run ( cause the aliases arent active till newline in
ran-from code ) the new aixz=( .. ) vakue doesnt get accepted, just the old
2 element content appears everywhere
+ aixz=("$ixzd"/+{ixz,kw})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
this sets it first and showing set -x till appearance first for that
addment check loop
i am sorry to paspte the follwoing
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
this indiicates, a bad alias that soureces the file
im sorry about this cause this was the result of bug hunting, in all v
ariants yet i couldnt make it work cause too bad bugs in bash =)
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
is the second element, as should supposed to be, adding +ixz and +kw aliases
now set the aixz=( new ) and .. fail
+ alxz=("$ixzd"/)
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
..
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
it went adding the same aliases again....
ixz.bug.varnotnewalias: line 13: KWS: command not found
indicates another fail, that KWS important element didnt get loaded
..
++ paste ENDFILE bug.varnotnewalias ( 54 lined 257 worded 1407 chared )
++ paste BEGINFILE ixz.bug.varnotnewalias
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/+{ixz,kw} )
. -- "$aixz"
alxz=( "$ixzd"/ )
+ixz
KWS
++ paste ENDFILE ixz.bug.varnotnewalias ( 13 lined 23 worded 217 chared )
++ paste BEGINFILE ixz.bug.varnotnewalias.o
+ ixz=ixz.bug.varnotnewalias
+ ixz=/root/ixz/ixz.bug.varnotnewalias
+ ixz=/root/ixz/ixz.bug.varnotnewalias
+ ixzd=/root/ixz
+ shopt -s extglob globstar expand_aliases dotglob
+ aixz=("$ixzd"/+{ixz,kw})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ alxz=("$ixzd"/)
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ KWS
ixz.bug.varnotnewalias: line 13: KWS: command not found
++ paste ENDFILE ixz.bug.varnotnewalias.o ( 63 lined 250 worded 1383 chared
)
++ paste BEGINFILE bug.varnotnewalias.2
here for more clearness i re-set aixz=( to ../nonexistant ) and in set -x
output i see this however the ${aixz[aixzi]} content still points to the
old container
++ paste ENDFILE bug.varnotnewalias.2 ( 3 lined 28 worded 160 chared )
++ paste BEGINFILE ixz.bug.varnotnewalias.2
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/+{ixz,kw} )
. -- "$aixz"
alxz=( "$ixzd"/nonexistant )
+ixz
KWS
++ paste ENDFILE ixz.bug.varnotnewalias.2 ( 13 lined 23 worded 228 chared )
++ paste BEGINFILE ixz.bug.varnotnewalias.2.o
+ ixz=ixz.bug.varnotnewalias.2
+ ixz=/root/ixz/ixz.bug.varnotnewalias.2
+ ixz=/root/ixz/ixz.bug.varnotnewalias.2
+ ixzd=/root/ixz
+ shopt -s extglob globstar expand_aliases dotglob
+ aixz=("$ixzd"/+{ixz,kw})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ alxz=("$ixzd"/nonexistant)
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ KWS
ixz.bug.varnotnewalias.2: line 13: KWS: command not found
++ paste ENDFILE ixz.bug.varnotnewalias.2.o ( 63 lined 250 worded 1402
chared )
++ paste BEGINFILE bug.varnotnewstillalias
here i '. add_me_switcher' rather than use the new alias
with same result, array content didnt get replaced, bug
peace
++ paste ENDFILE bug.varnotnewstillalias ( 4 lined 20 worded 116 chared )
++ paste BEGINFILE ixz.bug.varnotnewstillalias
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/+{ixz,kw} )
. -- "$aixz"
alxz=( "$ixzd"/ )
. -- "$ixzd"/+ixz
KWS
++ paste ENDFILE ixz.bug.varnotnewstillalias ( 13 lined 25 worded 230
chared )
++ paste BEGINFILE ixz.bug.varnotnewstillalias.o
+ ixz=ixz.bug.varnotnewstillalias
+ ixz=/root/ixz/ixz.bug.varnotnewstillalias
+ ixz=/root/ixz/ixz.bug.varnotnewstillalias
+ ixzd=/root/ixz
+ shopt -s extglob globstar expand_aliases dotglob
+ aixz=("$ixzd"/+{ixz,kw})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ alxz=("$ixzd"/)
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ KWS
ixz.bug.varnotnewstillalias: line 13: KWS: command not found
++ paste ENDFILE ixz.bug.varnotnewstillalias.o ( 63 lined 250 worded 1403
chared )
++ paste BEGINFILE bug.hangalias
i use alias on same line as section defining add ixz codes ( aixz=( .. )
var ) and, before tho it displayed it didnt run ( in set -x output simply
nothing of the alias \ code call ) , then now seems over few updates it
hangs bash, till c-c , maybe there is a mycode fault, but before .. time i
was off cause the bugs , it just showed in -x 'aixz=( .. ) <\n>' no alias
run
++ paste ENDFILE bug.hangalias ( 1 lined 82 worded 371 chared )
++ paste BEGINFILE ixz.bug.hangalias
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/+{ixz,kw} )
. -- "$aixz"
alxz=( "$ixzd"/ ) +ixz
KWS
++ paste ENDFILE ixz.bug.hangalias ( 12 lined 23 worded 218 chared )
++ paste BEGINFILE ixz.bug.hangalias.o
bash-5.1# bash -x ixz.bug.hangalias
+ ixz=ixz.bug.hangalias
+ ixz=/root/ixz/ixz.bug.hangalias
+ ixz=/root/ixz/ixz.bug.hangalias
+ ixzd=/root/ixz
+ shopt -s extglob globstar expand_aliases dotglob
+ aixz=("$ixzd"/+{ixz,kw})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
+ alxz=("$ixzd"/)
^C
bash-5.1#
++ paste ENDFILE ixz.bug.hangalias.o ( 37 lined 136 worded 801 chared )
++ paste BEGINFILE success.KWSran
that worked when i placed all in one call instead of multiple
but since i would need at least one keyword to be pre created alias
workage, this is not possible so i failed at this step too, by bash bugs
++ paste ENDFILE success.KWSran ( 2 lined 41 worded 201 chared )
++ paste BEGINFILE ixz.success.KWSran
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/{+{ixz,kw},KWS} )
. -- "$aixz"
KWS
++ paste ENDFILE ixz.success.KWSran ( 10 lined 19 worded 202 chared )
++ paste BEGINFILE ixz.success.KWSran.o
+ ixz=ixz.success.KWSran
+ ixz=/root/ixz/ixz.success.KWSran
+ ixz=/root/ixz/ixz.success.KWSran
+ ixzd=/root/ixz
+ shopt -s extglob globstar expand_aliases dotglob
+ aixz=("$ixzd"/{+{ixz,kw},KWS})
+ . -- /root/ixz/+ixz
++ aixzi=-1
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+ixz
++ aixzn=+ixz
++ [[ -e /root/ixz/+ixz ]]
++ [[ +ixz == *, ]]
++ [[ -d /root/ixz/+ixz ]]
++ [[ +ixz == *. ]]
++ [[ /root/ixz/+ixz == *= ]]
++ [[ -f /root/ixz/+ixz= ]]
++ alias -- '+ixz=
. -- '\''/root/ixz/+ixz'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/+kw
++ aixzn=+kw
++ [[ -e /root/ixz/+kw ]]
++ [[ +kw == *, ]]
++ [[ -d /root/ixz/+kw ]]
++ [[ +kw == *. ]]
++ [[ /root/ixz/+kw == *= ]]
++ [[ -f /root/ixz/+kw= ]]
++ alias -- '+kw=
. -- '\''/root/ixz/+kw'\''
'
++ [[ -v aixz[++aixzi] ]]
++ aixzf=/root/ixz/KWS
++ aixzn=KWS
++ [[ -e /root/ixz/KWS ]]
++ [[ KWS == *, ]]
++ [[ -d /root/ixz/KWS ]]
++ [[ KWS == *. ]]
++ [[ /root/ixz/KWS == *= ]]
++ [[ -f /root/ixz/KWS= ]]
++ alias -- 'KWS=
. -- '\''/root/ixz/KWS'\''
'
++ [[ -v aixz[++aixzi] ]]
+ . -- /root/ixz/KWS
++ SUBSEP=$'\035'
++ declare -gA KWS
++ paste ENDFILE ixz.success.KWSran.o ( 48 lined 188 worded 1044 chared )
++ paste BEGINFILE featurereq.recursivealiases
i use aliases for speed
i can handle args easily
can i have recursive same named alias calls ?
i understand the majority would fuck up, but its a demanding simple feature
for fast code shortments
and and and
..
++ paste ENDFILE featurereq.recursivealiases ( 9 lined 40 worded 205 chared
)
++ paste BEGINFILE bug.newaliasesnotavailabletillnewline
the ixz +ixz now usually was two times a loop over stuff to include as
aliases or as keywords in assoc arrays
that cause, aliases can not be used till next code line, for stupid old
outdated wrong reasons, so i added 1. main includes 2. stuff that may use em
and yea that bugs, cause i wanted include=( dir1 elem2 .. ) and loop
'smartly' over it to autoinclude everything , but say +kw is an alias that
sets assoc_array[ .. ] for further [[ -v usage , but adding it even first
in a loop that will use it later returns in .. i think .. command not found
.. even in my case with including a multiline file , only in
current_main_code_file as somewhen later line they work, very .. not good
++ paste ENDFILE bug.newaliasesnotavailabletillnewline ( 3 lined 135 worded
685 chared )
++ paste BEGINFILE bug.aliasnotavailable
i added aliases in a loop and to use em
the actualy alias keyword code contaiing parts are in different files with
newlines
however the aliases arent available till new codeline, which makes
optimizations fatally not possible
plz fix ?
++ paste ENDFILE bug.aliasnotavailable ( 5 lined 40 worded 232 chared )
++ paste BEGINFILE ixz
#!/bin/bash --init-file
ixz=${BASH_SOURCE##/*} ixz=${ixz:+$PWD/$ixz} ixz=${ixz:-$BASH_SOURCE}
ixzd=${ixz%/*}
shopt -s extglob globstar expand_aliases dotglob
aixz=( "$ixzd"/{+{ixz,kw},KWS} )
. -- "$aixz"
KWS
++ paste ENDFILE ixz ( 10 lined 19 worded 202 chared )
++ paste 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
++ paste ENDFILE +ixz ( 45 lined 125 worded 676 chared )
++ paste BEGINFILE +kw
KWS[$kws$SUBSEP$(( ++kwids ))${SUBSEP}takes]=$akwt oI=$IFS IFS=$'\n'
KWS[$kws$SUBSEP$kwids${SUBSEP}code]="${akwc[*]}" IFS=$oI
for cakw in "${akw[@]}"
do KWS[$kws${SUBSEP}kw$SUBSEP$cakw]=$kwids
done
++ paste ENDFILE +kw ( 7 lined 14 worded 195 chared )
++ paste BEGINFILE KWS
SUBSEP=$'\035'
declare -gA KWS
++ paste ENDFILE KWS ( 5 lined 4 worded 30 chared )
++ paste BEGINFILE IA.
IAi=${#IAI[@]} IAI[IAi]=
for IAs in "${kwa[@]}"
do IAA[$IAs]=$IAi
done
++ paste ENDFILE IA. ( 4 lined 9 worded 67 chared )
++ paste BEGINFILE IA..
eo
++ paste ENDFILE IA.. ( 1 lined 1 worded 2 chared )
++ paste BEGINFILE IA~.
declare -n IAI=$1 IAA=$2
++ paste ENDFILE IA~. ( 1 lined 4 worded 24 chared )
++ paste BEGINFILE IA~..
2
++ paste ENDFILE IA~.. ( 1 lined 1 worded 1 chared )
++ paste BEGINFILE ekw
KWS=( ) kwids=
++ paste ENDFILE ekw ( 1 lined 3 worded 15 chared )
++ paste BEGINFILE ifkwe
if [[ -v kwe ]]
then unset kwe
kweval
fi
++ paste ENDFILE ifkwe ( 7 lined 10 worded 39 chared )
++ paste BEGINFILE ifkweo
if [[ -v kweo ]]
then if [[ "$kweo" == "$ckwp" ]]
then unset kweo
eval -- "${ckwpe:-}"
else kwa+=( "$ckwp" )
fi
continue
fi
++ paste ENDFILE ifkweo ( 11 lined 25 worded 123 chared )
++ paste BEGINFILE kweval
eval -- "${ckwpe:-}"
++ paste ENDFILE kweval ( 4 lined 3 worded 21 chared )
++ paste BEGINFILE kwp
unset kwe{,o}
for ckwpi in ${!kwp[@]}
do ifkwe
ckwp=${kwp[ckwpi]} ckwpid=${KWS[$kws${SUBSEP}kw$SUBSEP$ckwp]}
ckwpe=${KWS[$kws$SUBSEP$ckwpid${SUBSEP}code]}
ckwpt=${KWS[$kws$SUBSEP$ckwpid${SUBSEP}takes]}
ifkweo
if [[ "$ckwpt" == *([0-9]) ]]
then if (( ckwpt > 0 ))
then kwe= kwa=( "{kwp[@]:ckwpi +1:ckwpt}" )
continue $ckwpt
else
kwa=( )
fi
else kweo=$ckwp kwa=( )
continue
fi
kweval
done
ifkwe
++ paste ENDFILE kwp ( 22 lined 47 worded 397 chared )
++ paste END ++ 36 files 665 lines 2855 words 16483 chars
o
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- a few bugs, i hope you can read it,
Alex fxmbsw7 Ratchev <=