the last analyzement of the weirdness is
arr=( .. )
_alias_
then it at least runs thru one arr[0], which is set, and evals the code
right and working, however on the next [[ -v arr[1] ]] ( empty ) check it
hangs
if i dont write the newline after arr=( .. ) for like usual, i get hung on
already a
by second [[ -v arr[elem] ]] n after hangs i mean i have two parts in this
one is the kws index array with keywords to parse, the other is kws the
alias that parses the ${kws[@]} arr
so for the first element there in the last mail it worked
and displayed the content of the alias, as the code
but on
so i fixed the code to have a newline before using the kws alias
it, to my half surprise, works perfectly, it displays the metest keyword
right, but on the second [[ -v arr[elem] ]] check it hangs, probably brk
ing few then mmaping and unmapping much, == bug ? :)
bash-5.1# bash ogt_demo
+ bash
sorry for changing topics, i try .. its still the same topic code
the code (error, bug) is included in 'kws' which is supposed to eval set
keywords
i do
kws=( something ) kws
it hangs
i do
kws=( something ) ; kws
it hangs
i do only kws ( when the var is set already from last time ) it processes
n
..based on it, c pros, you can prolly see clearly whats wrong
it like mmaps more and more memory beeing slower every run
) = 3
write(2, "++ [[ -v addkw[++addkw_i] ]]\n", 29++ [[ -v addkw[++addkw_i] ]]
) = 29
write(2, "++ dat[$nspace${SUBSEP}kw$SUBSEP"..., 53++
dat[$nspace${SUB
On Tue, Feb 23, 2021 at 04:33:44PM -0500, Chet Ramey wrote:
> On 2/22/21 8:11 AM, Mike Jonkmans wrote:
> >
> > Hi,
> >
> > It seems some things are missing in the bash manual.
> > Notably definition of command and placements of coproc- and
> > function-definition.
> >
> > The section 'SHELL GRA
i cannot exclude it'd be my bug ( again ) but i dunno i have no choise than
trying to present the hanger to you folks to fix it
if you'd unpack ogt1.tgz ull find ogt1/ and some dirs and scripts, the code
from the other paste didnt change, i just try to explain it so you dont
have a that hard time t
On 2/23/21 10:55 AM, Greg Wooledge wrote:
Oğuz (oguzismailuy...@gmail.com) wrote:
`(( assoc[\$var]++ ))' works fine as usual.
unicorn:~$ bash-5.1
unicorn:~$ declare -A hash
unicorn:~$ key=\'\]
unicorn:~$ hash[$key]=17
unicorn:~$ (( hash[\$key]++ ))
unicorn:~$ declare -p hash
declare -A hash=([
On 2/22/21 10:09 PM, L A Walsh wrote:
export _home_prefix=${HOME%/*}/
I can't reproduce it, though I'm sure this is the line where it
crashes for you. What is HOME set to?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
C
On 2/22/21 8:11 AM, Mike Jonkmans wrote:
Hi,
It seems some things are missing in the bash manual.
Notably definition of command and placements of coproc- and function-definition.
The section 'SHELL GRAMMAR' describes:
- simple-command
- pipeline
- list
- compound-command
- coproc
- function-de
On 2/23/21 7:54 AM, Léa Gris wrote:
https://ideone.com/iw2pSv
#!/usr/bin/env bash
declare -r r
r=2 || exit 2
OK, let's pick this one. This is what POSIX calls a "variable assignment
error" in
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01
(you've om
23 Şubat 2021 Salı tarihinde Greg Wooledge yazdı:
> Oğuz (oguzismailuy...@gmail.com) wrote:
> > `(( assoc[\$var]++ ))' works fine as usual.
>
> unicorn:~$ bash-5.1
> unicorn:~$ declare -A hash
> unicorn:~$ key=\'\]
> unicorn:~$ hash[$key]=17
> unicorn:~$ (( hash[\$key]++ ))
> unicorn:~$ declare -
Oğuz (oguzismailuy...@gmail.com) wrote:
> `(( assoc[\$var]++ ))' works fine as usual.
unicorn:~$ bash-5.1
unicorn:~$ declare -A hash
unicorn:~$ key=\'\]
unicorn:~$ hash[$key]=17
unicorn:~$ (( hash[\$key]++ ))
unicorn:~$ declare -p hash
declare -A hash=(["']"]="18" )
unicorn:~$ (( 'hash[$key]'++ ))
23 Şubat 2021 Salı tarihinde Greg Wooledge yazdı:
> On Tue, Feb 23, 2021 at 02:03:55PM +0100, Andreas Schwab wrote:
> > On Feb 23 2021, Greg Wooledge wrote:
> >
> > > No amount of quoting will make (( 'assoc[$var]'++ )) work.
> >
> > (( assoc[var]++ ))
> >
> > Andreas.
>
> This is not the same as
23 Şubat 2021 Salı tarihinde Léa Gris yazdı:
> https://ideone.com/iw2pSv
>
> #!/usr/bin/env bash
>> declare -r r
>> r=2 || exit 2
>
>
There is no command substitution in `r=2', it will either succeed and
return zero, or fail and cause the shell to discard the whole command (`r=2
|| exit 2'); `e
On Tue, Feb 23, 2021 at 02:03:55PM +0100, Andreas Schwab wrote:
> On Feb 23 2021, Greg Wooledge wrote:
>
> > No amount of quoting will make (( 'assoc[$var]'++ )) work.
>
> (( assoc[var]++ ))
>
> Andreas.
This is not the same as assoc[$var]. Yours uses the literal string var
as the key, not the
On Tue, Feb 23, 2021 at 02:03:30PM +0100, Léa Gris wrote:
> (
> LANG=C
> unset var assoc
> var=\'\]
> declare -Ai assoc
> assoc[$var]=1
> assoc[$var]+=1
> ((assoc['$var']++))
> typeset -p assoc
> )
This "works" in bash 5.0 but not in Debian's bash 5.1. The -i flag is
irrelevant as
On Feb 23 2021, Greg Wooledge wrote:
> No amount of quoting will make (( 'assoc[$var]'++ )) work.
(( assoc[var]++ ))
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Le 23/02/2021 à 13:55, Greg Wooledge écrivait :
On Tue, Feb 23, 2021 at 12:17:10PM +0100, Alex fxmbsw7 Ratchev wrote:
what, sorry, mailing stuff isnt much clear to me, ... its not possible to
have a var=\'\] ; assoc[$var] ?
It should work for simple assignment and retrieval.
You need to add q
On Tue, Feb 23, 2021 at 12:17:10PM +0100, Alex fxmbsw7 Ratchev wrote:
> what, sorry, mailing stuff isnt much clear to me, ... its not possible to
> have a var=\'\] ; assoc[$var] ?
It should work for simple assignment and retrieval.
You need to add quotes for [[ -v 'assoc[$var]' ]] to work, and ma
https://ideone.com/iw2pSv
#!/usr/bin/env bash
declare -r r
r=2 || exit 2
echo 'still there with $?='$?', after: r=2 || exit 2'
if ! r='hello'; then exit; fi
echo "still there with \$?=$?, after: if ! r='hello'; then exit; fi"
typeset -p r
Output:
still there with $?=1, after: r=2
yeah i thought so.. thanks
On Tue, Feb 23, 2021 at 12:52 PM Léa Gris wrote:
> Le 23/02/2021 à 12:17, Alex fxmbsw7 Ratchev écrivait :
> > what, sorry, mailing stuff isnt much clear to me, ... its not possible to
> > have a var=\'\] ; assoc[$var] ?
>
> You can if assoc is declared an associative a
Le 23/02/2021 à 12:17, Alex fxmbsw7 Ratchev écrivait :
what, sorry, mailing stuff isnt much clear to me, ... its not possible to
have a var=\'\] ; assoc[$var] ?
You can if assoc is declared an associative array before:
$ (LANG=C; unset var assoc; var=\'\]; assoc[$var]=hello; typeset -p assoc)
what, sorry, mailing stuff isnt much clear to me, ... its not possible to
have a var=\'\] ; assoc[$var] ?
On Mon, Feb 22, 2021 at 5:48 PM Chet Ramey wrote:
> On 2/15/21 1:28 PM, Daniel Gröber wrote:
>
> > On Mon, Feb 15, 2021 at 09:11:48AM -0500, Chet Ramey wrote:
> >> `test' is always going to
24 matches
Mail list logo