Re: read command sometimes misses newline on timeout

2024-10-07 Thread alex xmb sw ratchev
the same > situatiation that I hit in a real world example in which I don't control > the input. > ---------- > *Von:* alex xmb sw ratchev > *Gesendet:* Montag, 7. Oktober 2024 19:17 > *An:* Thomas Oettli > *Cc:* bug-bash@gnu.org ; chet.ra...@case.edu < &g

Re: read command sometimes misses newline on timeout

2024-10-07 Thread alex xmb sw ratchev
> sleep .00$(($RANDOM%10)) > echo > done > ) > > > Could you please explain to me, where exactly the mistake is? I don't know > if you ran the script by yourself, but on all of my machines it exits after > just a few seconds > with the f

Re: read command sometimes misses newline on timeout

2024-10-07 Thread alex xmb sw ratchev
there is a case , u [[ $readreply ]] after read On Monday, October 7, 2024, Thomas Oettli via Bug reports for the GNU Bourne Again SHell wrote: > I agree with you, but it should never happen that read returns timeout, > also returns the full line and has already read the newline character. > If

Re: fg via keybind modifies tty settings

2024-09-22 Thread alex xmb sw ratchev
happened here with nvim and termux same as description On Sunday, September 22, 2024, Martin D Kealey wrote: > Does this happen with any raw-mode application, or just vim? > > When using readline in Emacs mode, the terminal is necessarily in raw mode. > > I suspect what you're seeing is that 'fg

Re: [feature request] Add ".sh" or ".bash" extension to tmpfile generated by `fc`

2024-09-22 Thread alex xmb sw ratchev
On Saturday, September 21, 2024, Chet Ramey wrote: > On 9/21/24 1:03 AM, Oğuz wrote: > >> On Saturday, September 21, 2024, Koichi Murase > > wrote: >> >> Emacs has `auto-mode-alist'. VS Code has `files.associations'. >> >> >> I think he meant a command line opti

Re: Suggested BASH Improvement

2024-09-17 Thread alex xmb sw ratchev
another is ${var##0} On Wednesday, September 18, 2024, BRUCE FOWLER via Bug reports for the GNU Bourne Again SHell wrote: > An interesting problem I ran into recently: > > I have a shell script that I run about once a month that > "screen-scrapes" from the output of another program using the > s

Re: (question) fast split/join of strings

2024-09-17 Thread alex xmb sw ratchev
cool .. gotta do .. thxx n greets .. On Tuesday, September 17, 2024, Greg Wooledge wrote: > On Tue, Sep 17, 2024 at 17:00:16 +0200, alex xmb sw ratchev wrote: > > plz what does 'local -' do , its newer to me > > i forgot all about it already > >

Re: (question) fast split/join of strings

2024-09-17 Thread alex xmb sw ratchev
do , its newer to me i forgot all about it already thanks greets On Tuesday, September 17, 2024, Greg Wooledge wrote: > On Tue, Sep 17, 2024 at 16:07:58 +0200, alex xmb sw ratchev wrote: > > savedifs=${IFS@A} savedifs=${savedifs:- unset -v IFS } > > str=1,2,3 IFS=, arr=( $str ) join

Re: (question) fast split/join of strings

2024-09-17 Thread alex xmb sw ratchev
in the printf to stdout a final printf \\n is missing greets On Tuesday, September 17, 2024, alex xmb sw ratchev wrote: > savedifs=${IFS@A} savedifs=${savedifs:- unset -v IFS } > str=1,2,3 IFS=, arr=( $str ) joined=${arr[*]} > eval "$savedifs" > > alternative middle

Re: (question) fast split/join of strings

2024-09-17 Thread alex xmb sw ratchev
savedifs=${IFS@A} savedifs=${savedifs:- unset -v IFS } str=1,2,3 IFS=, arr=( $str ) joined=${arr[*]} eval "$savedifs" alternative middleline sep=, str=1$sep2$sep3 IFS=$sep arr=( $str ) joined=${arr[*]} ( at var=assignment , quotes dont matter , excepts to bind spaced code together as cmd or cmd

Re: Question on $@ vs $@$@

2024-08-26 Thread alex xmb sw ratchev
try ${@@Q} and ${*@Q} greets On Wed, Aug 14, 2024, 2:45 AM Steffen Nurpmeso wrote: > Hello. > > I include bug-bash even though i think bash is correct, but there > lots of people of expertise are listening, so, thus. > Sorry for cross-posting, nonetheless. > Given this snippet (twox() withou

Re: $@ in function gives error

2024-08-17 Thread alex xmb sw ratchev
On Fri, Aug 16, 2024, 23:29 freek--- via Bug reports for the GNU Bourne Again SHell wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 > -fstack-protec

Re: $@ in function gives error

2024-08-17 Thread alex xmb sw ratchev
On Sat, Aug 17, 2024, 12:42 Freek de Kruijf wrote: > Op zaterdag 17 augustus 2024 00:29:23 CEST schreef u: > > On Fri, Aug 16, 2024, at 12:59 PM, freek--- via Bug reports for the GNU > > > There is no problem with "$@" or functions here. The "problem" is > > that "$@" expands to multiple fields

Re: Question on $@ vs $@$@

2024-08-13 Thread alex xmb sw ratchev
On Wed, Aug 14, 2024, 02:45 Steffen Nurpmeso wrote: > Hello. > > I include bug-bash even though i think bash is correct, but there > lots of people of expertise are listening, so, thus. > Sorry for cross-posting, nonetheless. > Given this snippet (twox() without argument it is) > > one() { echo

Re: whats wrong , exit code 11 on android termux

2024-08-10 Thread alex xmb sw ratchev
On Sat, Aug 10, 2024, 05:02 Oğuz wrote: > On Saturday, August 10, 2024, Martin D Kealey > wrote: > > > Sorry, that was supposed to be a personal reply off-list. > > > > Do you always harass foreigners like that or was it an exception? > im not so a foreigner , .. began coding bash and awk on fr

Re: whats wrong , exit code 11 on android termux

2024-08-10 Thread alex xmb sw ratchev
Aug 2024 at 03:14, alex xmb sw ratchev >> wrote: >> >>> mr chet >>> >> >> I REALLY get annoyed when strangers call me "Mister Martin" or write "Mr >> Martin". I am NOT a child, so how DARE they mock me like that. >> >>

Re: whats wrong , exit code 11 on android termux

2024-08-07 Thread alex xmb sw ratchev
okay ill look i suggest u add release version patch ? thxx .. greets .. On Wed, Aug 7, 2024, 21:52 Chet Ramey wrote: > On 8/7/24 3:51 PM, alex xmb sw ratchev wrote: > > that means .. its in devel patch ? cause its 2023 .. > > Yes, it's in devel and has been since June, 2023

Re: whats wrong , exit code 11 on android termux

2024-08-07 Thread alex xmb sw ratchev
that means .. its in devel patch ? cause its 2023 .. On Wed, Aug 7, 2024, 21:43 Chet Ramey wrote: > On 8/7/24 1:14 PM, alex xmb sw ratchev wrote: > > mr chet .. any answer to this .. > > You already saw the right answer. > > https://lists.gnu.org/archive/html/bug-bash/

Re: whats wrong , exit code 11 on android termux

2024-08-07 Thread alex xmb sw ratchev
mr chet .. any answer to this .. On Tue, Aug 6, 2024, 20:18 alex xmb sw ratchev wrote: > ~ $ alias tm='timemark+=( $EPOCHREALTIME )' > ~ $ tm > > [Process completed (signal 11) - press Enter] > > btw is it to send to bug and help .. ? >

Re: whats wrong , exit code 11 on android termux

2024-08-06 Thread alex xmb sw ratchev
.. thanks tho , greycat .. greets .. On Tue, Aug 6, 2024, 21:38 alex xmb sw ratchev wrote: > my argument against function was its way slower > it isnt much for this project but the overall ' timings adding ' project > > if its a bash bug , my code's not fault , and i

Re: whats wrong , exit code 11 on android termux

2024-08-06 Thread alex xmb sw ratchev
:59:08 +0200, alex xmb sw ratchev wrote: > > maybe its this i completly dunno > > > > i guess i must start use devel branch ? > > > > On Tue, Aug 6, 2024, 20:45 Grisha Levit wrote: > > > > > On Tue, Aug 6, 2024, 14:19 alex xmb sw ratchev > wrote: >

Re: whats wrong , exit code 11 on android termux

2024-08-06 Thread alex xmb sw ratchev
maybe its this i completly dunno i guess i must start use devel branch ? On Tue, Aug 6, 2024, 20:45 Grisha Levit wrote: > On Tue, Aug 6, 2024, 14:19 alex xmb sw ratchev wrote: > >> ~ $ alias tm='timemark+=( $EPOCHREALTIME )' >> ~ $ tm >> >> [Pro

whats wrong , exit code 11 on android termux

2024-08-06 Thread alex xmb sw ratchev
~ $ alias tm='timemark+=( $EPOCHREALTIME )' ~ $ tm [Process completed (signal 11) - press Enter] btw is it to send to bug and help .. ?

Re: Potentially misleading documentation of SECONDS variable

2024-08-06 Thread alex xmb sw ratchev
i think this includes if u start a bash set clock 1h to future and query after 1s , it may show not 0 or 1 second On Tue, Aug 6, 2024, 18:26 Koichi Murase wrote: > 2024年8月7日(水) 0:24 Bash-help via Bug reports for the GNU Bourne Again > SHell : > > Reading the manual at > >

Re: Potentially misleading documentation of SECONDS variable

2024-08-06 Thread alex xmb sw ratchev
try unset -v SECONDS first On Tue, Aug 6, 2024, 17:24 Bash-help via Bug reports for the GNU Bourne Again SHell wrote: > Reading the manual at > > regarding the SECONDS variable, it states that > " [..] Assignment to this varia

Re: waiting for process substitutions

2024-08-06 Thread alex xmb sw ratchev
On Tue, Aug 6, 2024, 13:59 Zachary Santer wrote: > On Tue, Aug 6, 2024 at 1:19 AM Oğuz wrote: > > > > The benefit is they're separate from async jobs and don't get in your > way. `wait' waiting for the last procsub is acceptable, `wait' waiting for > a procsub that I forgot about and that won't

Re: waiting for process substitutions

2024-08-05 Thread alex xmb sw ratchev
imo have multiple $! at once set is to me a hard must , when more are invoked .. this is a programmical must .. or do only i see these schematics .. a no is brainless .. .. in the way not supporting floating math .. so i should not care so much =pp =) On Tue, Aug 6, 2024, 07:19 Oğuz wrote: > On

Re: proposed BASH_SOURCE_PATH

2024-07-29 Thread alex xmb sw ratchev
s : BASH_SOURCE_REAL : BASH_SOURCE_ABSOLUTE On Thu, Jul 25, 2024, 15:10 Chet Ramey wrote: > On 7/18/24 4:44 PM, konsolebox wrote: > > On Thu, Jul 18, 2024 at 11:02 PM Chet Ramey wrote: > >> > >> On 7/11/24 3:51 AM, konsolebox wrote: > >>> On Thu, Jul 11, 2024 at 4:08 AM Chet Ramey > wrote: > >

Re: Local variable can not unset within shell functions

2024-07-11 Thread alex xmb sw ratchev
On Thu, Jul 11, 2024, 16:34 alex xmb sw ratchev wrote: > > > On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote: > >> Hi, >> >> I've a report that with later bash the following which works in bash-4.2 >> >> x () { >> local x=y >>

Re: Local variable can not unset within shell functions

2024-07-11 Thread alex xmb sw ratchev
On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote: > Hi, > > I've a report that with later bash the following which works in bash-4.2 > > x () { > local x=y > declare -p x > echo $x > unset x > declare -p x > echo $x > } > > with > > linux-40cm:~ # x () { > > local x=y > > de

Re: waiting for process substitutions

2024-07-08 Thread alex xmb sw ratchev
On Mon, Jul 8, 2024, 22:57 Greg Wooledge wrote: > On Mon, Jul 08, 2024 at 22:45:35 +0200, alex xmb sw ratchev wrote: > > On Mon, Jul 8, 2024, 22:15 Chet Ramey wrote: > > > > > On 7/8/24 4:02 PM, alex xmb sw ratchev wrote: > > > > > > > hi , one que

Re: waiting for process substitutions

2024-07-08 Thread alex xmb sw ratchev
On Mon, Jul 8, 2024, 22:15 Chet Ramey wrote: > On 7/8/24 4:02 PM, alex xmb sw ratchev wrote: > > > hi , one question about .. > > if a cmd contains more substitions like >( or <( , how to get all $! > > maybe make ${![]} , or is such already .. ? > > You can&

Re: waiting for process substitutions

2024-07-08 Thread alex xmb sw ratchev
On Mon, Jul 8, 2024, 21:55 Chet Ramey wrote: > On 7/8/24 3:27 PM, Dale R. Worley wrote: > > Greg Wooledge writes: > >> Some scripts use something like this: > >> ... > >> exec > >(command ...) ... > > > > I've used that construction quite a few times myself. I'm not > > requesting that the

Re: proposed BASH_SOURCE_PATH

2024-07-08 Thread alex xmb sw ratchev
On Mon, Jul 8, 2024, 10:16 Martin D Kealey wrote: > > > On Mon, 8 Jul 2024 at 14:42, Oğuz wrote: > >> On Monday, July 8, 2024, Martin D Kealey wrote: >>> >>> It's not possible to change "${BASH_SOURCE[@]}" without breaking some >>> existing code, >>> >> >> It's worth breaking existing code in t

Re: proposed BASH_SOURCE_PATH

2024-07-07 Thread alex xmb sw ratchev
On Sun, Jul 7, 2024, 21:03 Chet Ramey wrote: > On 7/3/24 5:32 PM, alex xmb sw ratchev wrote: > > is this all about adding full path ? to sourcr / . ? > > for this may add one varname , like BASH_SOURCE_FULL > > > > it seems to me , using BASH_SOURCE , if it doesnt sta

Re: 5.2.15(1)-release: RETURN trap not executed in cmd subst if last statement of fct is not builtin

2024-07-06 Thread alex xmb sw ratchev
maybe its scope .. 1st define trap 2 define and run func .. On Sat, Jul 6, 2024, 15:02 Emanuele Torre wrote: > On Sat, Jul 06, 2024 at 01:41:01PM +0200, Jens Schmidt wrote: > > Today I came across this one: > > > > [copy-on-select-2]$ echo $BASH_VERSION > > 5.2.15(1)-release > > [copy-on-s

Re: proposed BASH_SOURCE_PATH

2024-07-03 Thread alex xmb sw ratchev
is this all about adding full path ? to sourcr / . ? for this may add one varname , like BASH_SOURCE_FULL it seems to me , using BASH_SOURCE , if it doesnt start with / , prefix $PWD , .. else its already i say about nee var cause it'd be a derivate of , like , BASH_SOURCE warm greets .. On Wed

Re: feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices

2024-06-26 Thread alex xmb sw ratchev
On Wed, Jun 26, 2024, 8:30 PM Chet Ramey wrote: > On 6/26/24 2:18 PM, Zachary Santer wrote: > > >> On Tue, Jun 11, 2024, 12:49 PM Zachary Santer > wrote: > >>> > >>> $ array=( zero one two three four five six ) > >>> $ printf '%s\n' "${array[@]( 1 5 )}" > >>> one > >>> five > > > > This is diffe

Re: feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices

2024-06-26 Thread alex xmb sw ratchev
On Wed, Jun 26, 2024, 8:19 PM Zachary Santer wrote: > On Wed, Jun 26, 2024 at 11:19 AM alex xmb sw ratchev > wrote: > > > > printf %s\\n "${arr[@]:1:5}" > > For my array below, this would give you > one > two > three > four > five > >

Re: feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices

2024-06-26 Thread alex xmb sw ratchev
printf %s\\n "${arr[@]:1:5}" On Tue, Jun 11, 2024, 12:49 PM Zachary Santer wrote: > Was "bash tries to parse comsub in quoted PE pattern" > > On Wed, Oct 18, 2023 at 8:19 AM Zachary Santer wrote: > > > > In Bash 5.2: > > $ array=( zero one two three four five six ) > > $ printf '%s\n' "${array[

Re: printf, binary data, leading single quote and non ASCII codesets

2024-06-24 Thread alex xmb sw ratchev
termux : printf "$b" | { while LC_ALL=C read -N1 c; do LC_ALL=C.UTF-8 printf "%d %q\n" "'$c" "$c"; done; } 255 ÿ 190 $'\276' On Mon, Jun 24, 2024, 1:37 PM Gioele Barabucci wrote: > Hi, > > bash manpage says for printf contains the following statement: > > > if the leading character is a si

Re: set -a leads to truncated output from ps

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 10:23 PM Chet Ramey wrote: > On 6/21/24 3:18 PM, alex xmb sw ratchev wrote: > > > i see a BASH_EXCLUDE_AVAR > > Where do you see that? > in vague maybe-true future visions .. regarding the -a , to exclude vars from that rule , .. greets .. -- >

Re: REQUEST - bash floating point math support

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 10:21 PM Chet Ramey wrote: > On 6/21/24 3:59 PM, alex xmb sw ratchev wrote: > > > > If floating point math support is added to bash, I would expect > it to > > > be able to handle floating point literals in these forms as well. > &g

Re: REQUEST - bash floating point math support

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 9:58 PM Chet Ramey wrote: > On 6/17/24 8:04 AM, Zachary Santer wrote: > > On Mon, Jun 17, 2024 at 3:48 AM Léa Gris wrote: > >> > >> Le 17/06/2024 à 09:17, Koichi Murase écrivait : > >>> declare -i numvar=${localeFormatted/[!0-9]/.} > >> > >> This would break with negati

Re: set -a leads to truncated output from ps

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 8:58 PM Chet Ramey wrote: > On 6/15/24 10:28 AM, Oğuz wrote: > > > Yes. All I'm saying is, a variable that affects how certain programs > > behave when exported should not be implicitly exported by the shell, > > the user should do it manually if he wants. > > This is a non-

Re: proposed BASH_SOURCE_PATH

2024-06-21 Thread alex xmb sw ratchev
bash xmb.mepath declare -- mef="/data/data/com.termux/files/home/xmb.mepath" declare -- med="/data/data/com.termux/files/home" On Wed, Jun 19, 2024, 10:05 PM Will Allan wrote: > > Not sure how common but this is what makes sense. Or name sourceables > > foo.sh, bar.sh and executables foo, bar so

Re: Question that baffles AI (all of them)

2024-06-15 Thread alex xmb sw ratchev
bash dat.sh.1 1,2,3,4 a 1 , b 2 a 3 , b 4 or u meant to equally split the args ? On Sat, Jun 15, 2024, 11:30 PM Saint Michael wrote: > in this code: > data="'1,2,3,4','5,6,7,8'" > > # Define the processing function > process() { > echo "There are $# arguments." > echo "They are: $@" >

Re: REQUEST - bash floating point math support

2024-06-15 Thread alex xmb sw ratchev
On Sat, Jun 15, 2024, 4:56 PM Léa Gris wrote: > On 15/06/2024 à 15:29, Koichi Murase wrote : > > at which point does the conversion happens > > The conversion to LC_NUMERIC format only happens during variable > expansion outside of a numerical context. > The numerical context can be explicit if t

Re: it, soRE: set -a leads to truncated output from ps

2024-06-14 Thread alex xmb sw ratchev
u can try shopt -u checkwinsize to disable that columns settings On Thu, Jun 13, 2024, 8:29 PM Alain BROSSARD via Bug reports for the GNU Bourne Again SHell wrote: > Hi, > > You are correct, export COLUMNS does truncate, I had made the mistake > of replaying the previous execution of ps wh

Re: set -a leads to truncated output from ps

2024-06-13 Thread alex xmb sw ratchev
sorry i didnt see full mail .. bb .. On Thu, Jun 13, 2024, 4:22 PM alex xmb sw ratchev wrote: > it looks like normal cut ps out > try .. ps axw > maybe be some terminal lines 2nd+ hashing error > > On Thu, Jun 13, 2024, 3:46 PM Alain BROSSARD wrote: > >> Hi, >>

Re: set -a leads to truncated output from ps

2024-06-13 Thread alex xmb sw ratchev
i actually always did ww , but i didnt know here the difference .. On Thu, Jun 13, 2024, 4:24 PM Oğuz wrote: > On Thursday, June 13, 2024, Alain BROSSARD via Bug reports for the GNU > Bourne Again SHell wrote: > > > ># however, the second one has truncated output to the terminal > width

Re: set -a leads to truncated output from ps

2024-06-13 Thread alex xmb sw ratchev
additional documents at any time and free of charge, such > as a key information document pursuant to Art. 58 et seq. of the Financial > Services Act, a prospectus pursuant to Art. 35 et seq. of the Financial > Services Act or an equivalent foreign product information sheet, e.g. a > basic inf

Re: set -a leads to truncated output from ps

2024-06-13 Thread alex xmb sw ratchev
try the ps arg w for full length ps output why u set -a ? On Thu, Jun 13, 2024, 3:29 PM Alain BROSSARD via Bug reports for the GNU Bourne Again SHell wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLA

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ; args1 echo two three On Wed, Jun 12, 2024, 10:58 PM alex xmb sw ratchev wrote: > there are two output lines , for the two cmds , sorry gmail problem > > On Wed, Jun 12, 2024, 10:57 PM alex xmb sw ratchev >

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
there are two output lines , for the two cmds , sorry gmail problem On Wed, Jun 12, 2024, 10:57 PM alex xmb sw ratchev wrote: > ~ $ args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ; > args1 echo two three 'echo' 'foo' > 'echo'

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
~ $ args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ; args1 echo two three 'echo' 'foo' 'echo' 'two' 'three' ~ $ On Wed, Jun 12, 2024, 10:52 PM alex xmb sw ratchev wrote: > ~ $ logf=$HOME/alog1 ; run1() { print

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
~ $ logf=$HOME/alog1 ; run1() { printf '%(%F+%T%z)T %s' -1 "$1" >>"$logf" ; (( $# > 1 )) && printf \ %s "${@:2}" >>"$logf" ; "$@" ; >>"$logf" printf \\n ; } ; run1 echo foo ; cat "$logf" foo 2024-06-12+22:51:31+0200 echo foo ~ $ On Wed, Jun 12, 2024, 10:26 PM Greg Wooledge wrote: > On Wed, Jun 1

Re: sh vs. bash -xc 'a=b c=$a'

2024-05-23 Thread alex xmb sw ratchev
if u var=value command ; the var's only for cmd and disappears afterwards if u var=val ; cmd ; its not for cmd , excepts exported and is set after cmd , usual behav old rule On Thu, May 23, 2024, 3:34 PM Robert Elz wrote: > Date:Thu, 23 May 2024 09:04:48 -0400 > From:Ch

Re: [PATCH v2 5/8] builtins/source: parse the -i option

2024-05-21 Thread alex xmb sw ratchev
On Tue, May 21, 2024, 13:18 Koichi Murase wrote: > 2024年5月21日(火) 14:56 Phi Debian : > > Apparently konsolebox wrote a package manager, and survived the source > 'as > > is', yet he still advocate for 'enhancement'. I do have a package manager > > too, and survived source 'as is' and don't require

Re: [PATCH] globsort: handle int overflow in cmp functions

2024-05-20 Thread alex xmb sw ratchev
On Mon, May 20, 2024, 15:58 Chet Ramey wrote: > On 5/17/24 5:56 PM, Grisha Levit wrote: > > On Fri, May 17, 2024 at 3:06 PM Chet Ramey wrote: > >> > >> On 5/17/24 12:57 PM, Grisha Levit wrote: > >>> The current cmp implementation for size and blocks subtracts the two > >>> values and returns the

Re: printf -u "$fd"?

2024-05-19 Thread alex xmb sw ratchev
On Sun, May 19, 2024, 20:11 Kerin Millar wrote: > On Sun, 19 May 2024, at 5:08 PM, alex xmb sw ratchev wrote: > > On Sat, May 18, 2024, 04:54 Zachary Santer wrote: > > > >> Was «difference between read -u fd and read <&"$fd"» on > help-b...@gnu.or

Re: printf -u "$fd"?

2024-05-19 Thread alex xmb sw ratchev
On Sat, May 18, 2024, 04:54 Zachary Santer wrote: > Was «difference between read -u fd and read <&"$fd"» on help-b...@gnu.org > > On Thu, May 16, 2024 at 12:51 AM Kerin Millar wrote: > > > > On Thu, 16 May 2024, at 3:25 AM, Peng Yu wrote: > > > Hi, > > > > > > It appears to me that read -u fd an

Re: proposed BASH_SOURCE_PATH

2024-05-16 Thread alex xmb sw ratchev
bad gmail app buggs sorry , missed ending } [[ $BASH_SOURCE == /* ]] && medir=${BASH_SOURCE%/*} || { [[ $BASH_SOURCE != */* ]] && medir=$PWD || medir=$PWD/${BASH_SOURCE%/*} } On Thu, May 16, 2024, 15:48 alex xmb sw ratchev wrote: > maybe this one > > [[ $BASH_S

Re: proposed BASH_SOURCE_PATH

2024-05-16 Thread alex xmb sw ratchev
maybe this one [[ $BASH_SOURCE == /* ]] && medir=${BASH_SOURCE%/*} || { [[ $BASH_SOURCE != */* ]] && medir=$PWD || medir=$PWD/${BASH_SOURCE%/*} } On Thu, May 16, 2024, 15:45 alex xmb sw ratchev wrote: > > > On Thu, May 16, 2024, 15:43 alex xmb sw ratchev wrote:

Re: proposed BASH_SOURCE_PATH

2024-05-16 Thread alex xmb sw ratchev
On Thu, May 16, 2024, 15:43 alex xmb sw ratchev wrote: > > > On Thu, May 16, 2024, 14:37 Oğuz wrote: > >> On Wednesday, May 15, 2024, Chet Ramey wrote: >> >> > is it more common to have >> > something like the script in somewhere/bin, files to b

Re: proposed BASH_SOURCE_PATH

2024-05-16 Thread alex xmb sw ratchev
On Thu, May 16, 2024, 14:37 Oğuz wrote: > On Wednesday, May 15, 2024, Chet Ramey wrote: > > > is it more common to have > > something like the script in somewhere/bin, files to be sourced in > > somewhere/lib, and so on? > > > Not sure how common but this is what makes sense. Or name sourceables

Re: [bug #65651] argument reference inconsistency

2024-04-28 Thread alex xmb sw ratchev
On Sun, Apr 28, 2024, 13:59 Emanuele Torre wrote: > I don't know why this savannah ticket has been crossposted to @bug-bash, > but its replies have not been crossposted here: it is very confusing. > cool , thanks ... btw got me the link ? thxx && bless Anyway, they already got a response on sav

Re: [bug #65651] argument reference inconsistency

2024-04-28 Thread alex xmb sw ratchev
On Sun, Apr 28, 2024, 08:52 anonymous wrote: > URL: > > > Summary: argument reference inconsistency >Group: The GNU Bourne-Again SHell >Submitter: None >Submitted: Sun 28 Apr 2024 06:51:4

Re: History Expansion in Arithmetic Expansion

2024-03-23 Thread alex xmb sw ratchev
On Sat, Mar 23, 2024, 16:34 A4-Tacks wrote: > Configuration Information [Automatically generated, do not change]: > Machine: aarch64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -march=armv8-a -O2 -pipe -fstack-protector-strong > -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wfo

Re: ${var@A}; hypothetical, related parameter transformations

2024-03-20 Thread alex xmb sw ratchev
On Wed, Mar 20, 2024, 20:44 Greg Wooledge wrote: > On Wed, Mar 20, 2024 at 03:05:56PM -0400, Zachary Santer wrote: > > I want a declare command, no matter what ${var@A} gives me. I have to > > write a function for that: generate_declare_command (). That function > > can work a couple of reasonabl

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-20 Thread alex xmb sw ratchev
On Wed, Mar 20, 2024, 12:59 Greg Wooledge wrote: > On Wed, Mar 20, 2024 at 12:53:07PM +0100, alex xmb sw ratchev wrote: > > On Wed, Mar 20, 2024, 12:49 Greg Wooledge wrote: > > > > > On Wed, Mar 20, 2024 at 07:11:34AM -0400, Zachary Santer wrote: > > > &

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-20 Thread alex xmb sw ratchev
On Wed, Mar 20, 2024, 12:49 Greg Wooledge wrote: > On Wed, Mar 20, 2024 at 07:11:34AM -0400, Zachary Santer wrote: > > On Wed, Mar 20, 2024 at 12:29 AM Lawrence Velázquez > wrote: > > > A couple of previous discussions: > > > - https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00066.html

Re: Bash printf should diagnose integer overflow

2024-03-18 Thread alex xmb sw ratchev
On Mon, Mar 18, 2024, 15:40 Chet Ramey wrote: > On 3/13/24 8:57 PM, Paul Eggert wrote: > > > Revised patchset attached. The first patch uses the fix you suggested; > the > > remaining patches are similar to what I sent earlier, except the last > one > > is simplified since it doesn't need to worr

Re: Documentation Bug: ‘of’ should be ‘or’

2024-03-17 Thread alex xmb sw ratchev
+1 On Sun, Mar 17, 2024, 15:04 Abigail Read wrote: > As of > Reference Documentation for Bash Edition 5.2, for Bash Version 5.2. > September 2022 > > In 3.1.2.5 Locale-Specific Translation > Quoting from the first paragraph of this section: > If the current locale is C or POSIX, if there are no

Re: nameref and referenced variable scope, setting other attributes (was "local -g" declaration references local var in enclosing scope)

2024-03-14 Thread alex xmb sw ratchev
On Thu, Mar 14, 2024, 15:16 Zachary Santer wrote: > On Thu, Mar 14, 2024 at 9:54 AM Greg Wooledge wrote: > > > > I don't quite understand what this is saying. Do the variables have > > different names, or the same name? If they have different names, then > > the nameref shouldn't "hide" the ot

Re: nameref and referenced variable scope, setting other attributes (was "local -g" declaration references local var in enclosing scope)

2024-03-14 Thread alex xmb sw ratchev
On Thu, Mar 14, 2024, 12:08 Greg Wooledge wrote: > On Thu, Mar 14, 2024 at 08:27:33AM +0100, alex xmb sw ratchev wrote: > > how to unset a nameref > > Look at "help unset". Specifically the -n option. > thxx++ >

Re: nameref and referenced variable scope, setting other attributes (was "local -g" declaration references local var in enclosing scope)

2024-03-14 Thread alex xmb sw ratchev
how to unset a nameref On Wed, Mar 13, 2024, 20:44 Chet Ramey wrote: > On 3/10/24 7:29 PM, Zachary Santer wrote: > > > Bash Version: 5.2 > > Patch Level: 26 > > Release Status: release > > > > Description: > > > > On Sun, Mar 10, 2024 at 3:55 PM Zachary Santer > wrote: > >> > >> Relatedly, how

Re: multi-threaded compiling

2024-03-13 Thread alex xmb sw ratchev
On Wed, Mar 13, 2024, 08:26 Mischa Baars wrote: > On Tue, Mar 12, 2024 at 10:00 PM Paul Smith wrote: > > > On Tue, 2024-03-12 at 13:37 +0100, Mischa Baars wrote: > > > > I'd still like to hear why you aren't simply using "make -j". > > > > > > That's because I don't want to define static compile

Re: multi-threaded compiling

2024-03-12 Thread alex xmb sw ratchev
On Tue, Mar 12, 2024, 12:49 Greg Wooledge wrote: > On Tue, Mar 12, 2024 at 09:42:22AM +0100, Mischa Baars wrote: > > Here's the script and the Makefile using "printf '<%s>'": > > Sadly, your mail user agent chose to attach "Makefile" with content-type > application/octet-stream, which my MUA (mut

Re: multi-threaded compiling

2024-03-12 Thread alex xmb sw ratchev
On Tue, Mar 12, 2024, 09:26 Mischa Baars wrote: > On Mon, Mar 11, 2024 at 10:26 PM Chet Ramey wrote: > > > On 3/11/24 3:44 PM, Mischa Baars wrote: > > > On Mon, 11 Mar 2024, 20:20 Chet Ramey, > > > wrote: > > > > > > On 3/11/24 2:50 PM, Mischa Baars wrote: > > >

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
t2() { sleep .75 return 3 } run 'echo 1/1' 'echo 1/2' sleep 1 run 'echo 2/1' 'echo 2/2' t2 wa wa On Mon, Mar 11, 2024, 22:45 alex xmb sw ratchev wrote: > > > On Mon, Mar 11, 2024, 22:40 alex xmb sw ratchev wrote: > >> >> >

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 22:40 alex xmb sw ratchev wrote: > > > On Mon, Mar 11, 2024, 22:36 alex xmb sw ratchev wrote: > >> ~ $ bash xmb.smallt >> pid 14333 cmd t2 returned 3 >> pid 14332 cmd sleep 1 returned 0 >> >> ~ $ cat xmb.smallt >> #!/bin/bas

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 22:40 alex xmb sw ratchev wrote: > > > On Mon, Mar 11, 2024, 22:36 alex xmb sw ratchev wrote: > >> ~ $ bash xmb.smallt >> pid 14333 cmd t2 returned 3 >> pid 14332 cmd sleep 1 returned 0 >> >> ~ $ cat xmb.smallt >> #!/bin/bas

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 22:36 alex xmb sw ratchev wrote: > ~ $ bash xmb.smallt > pid 14333 cmd t2 returned 3 > pid 14332 cmd sleep 1 returned 0 > > ~ $ cat xmb.smallt > #!/bin/bash > > run() { > local IFS=' ' run=$* > eval "$run &" >

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
~ $ bash xmb.smallt pid 14333 cmd t2 returned 3 pid 14332 cmd sleep 1 returned 0 ~ $ cat xmb.smallt #!/bin/bash run() { local IFS=' ' run=$* eval "$run &" me[$!]=$run } wa() { local pid wait -n -p pid printf %s\\n "pid $pid cmd ${me[pid]} returned $?" } t2() { sleep .75 return 3 } run sl

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
bash s wait returns the exit code of the proc from the job On Mon, Mar 11, 2024, 20:52 Mischa Baars wrote: > On Mon, 11 Mar 2024, 20:36 Greg Wooledge, wrote: > > > > On Mon, Mar 11, 2024, 20:13 Mischa Baars > > > > wrote: > > > > > > > Also I don't think that gives you an exit status for each

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
t; On Mon, 11 Mar 2024, 20:03 alex xmb sw ratchev, wrote: > >> >> >> On Mon, Mar 11, 2024, 20:03 alex xmb sw ratchev >> wrote: >> >>> the logic between my code >>> >>> 1 threads_max >>> 2 loop >>> 3 inside loop , do if r

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 20:03 alex xmb sw ratchev wrote: > the logic between my code > > 1 threads_max > 2 loop > 3 inside loop , do if run is > than threads_max then wait -n one > then 4 spawn thread > 3 if run isnt more than max , simply ignore and spawn thread in next c

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
)); do exit $i; done; for (( i=0; i<32; i++ )); do >> wait -n; echo $?; done; >> >> Because this doesn't and to be honest, I needed the pid and its index to >> retrieve gcc's output from a log file array afterwards. >> >> On Mon, Mar 11, 2024 a

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
other output ~/2024031100 - gnu questions/one $ make SECONDS=5; for (( i=0;i<32;i++ )); do { exit ${i}; } & pid[${i}]=${!}; done; sleep ${SECONDS}; for (( i=0;i<32;i++ )); do wait -n ${pid[${i}]}; e=${?}; echo "$(printf %3u ${i}) pid ${pid[${i}]} exit ${e}"; done; /data/data/com.termux/files/usr/b

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 19:25 alex xmb sw ratchev wrote: > > > On Mon, Mar 11, 2024, 19:22 Mischa Baars > wrote: > >> On Mon, Mar 11, 2024 at 6:22 PM alex xmb sw ratchev >> wrote: >> >>> i also completly dont get ur issue >>> >>> f=( a

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
On Mon, Mar 11, 2024, 19:22 Mischa Baars wrote: > On Mon, Mar 11, 2024 at 6:22 PM alex xmb sw ratchev > wrote: > >> i also completly dont get ur issue >> >> f=( a.c b.c .. ) threads=$( nproc ) i=-1 r= >> >> while [[ -v f[++i] ]] ; do >> (( ++

Re: multi-threaded compiling

2024-03-11 Thread alex xmb sw ratchev
i also completly dont get ur issue f=( a.c b.c .. ) threads=$( nproc ) i=-1 r= while [[ -v f[++i] ]] ; do (( ++r > threads )) && wait -n gcc -c "${f[i]}" & done On Mon, Mar 11, 2024, 18:16 Mischa Baars wrote: > Hello Paul, > > It seems I'm awake a little longer than you are. > > The secon

Re: malloc: ../bash-5.2.21/dispose_cmd.c:249: assertion botched

2024-03-04 Thread alex xmb sw ratchev
On Mon, Mar 4, 2024, 19:07 Dennis Clarke via Bug reports for the GNU Bourne Again SHell wrote: > On 3/4/24 12:05, Chet Ramey wrote: > > On 2/29/24 12:11 PM, Dennis Clarke via Bug reports for the GNU Bourne > > Again SHell wrote: > >> > >> Well this has me a bit baffled. > >> > >> I downloaded the

Re: Bash 5.1: Make shell_script_filename available to startup files

2024-02-20 Thread alex xmb sw ratchev
On Tue, Feb 20, 2024, 17:53 Zachary Santer wrote: > On Tue, Feb 20, 2024 at 11:17 AM Chet Ramey wrote: > > > > > BASH_SOURCE and BASH_LINENO are part of the debugger support, and exist > so > > the debugger can create a function call stack. > > > > I've definitely used them to create my own call

Re: possible bash bug bringing job. to foreground

2024-02-19 Thread alex xmb sw ratchev
On Sat, Feb 17, 2024, 20:54 Greg Wooledge wrote: > On Sat, Feb 17, 2024 at 07:41:43PM +, John Larew wrote: > > After further examination, the examples with "fg $$" and "fg $!" clearly > do not bring the subshell into the foreground, as they are evaluated prior > to the subshells background ex

Re: declare -A +A

2024-02-12 Thread alex xmb sw ratchev
On Mon, Feb 12, 2024, 23:25 Koichi Murase wrote: > 2024年2月13日(火) 6:13 Chet Ramey : > > Only for indexed and associative arrays, since those are the attributes > > that cause changes in the underlying value storage format. That's > different > > than turning the integer attribute on and off, for i

Re: Slow history load with some values of HISTSIZE

2024-02-09 Thread alex xmb sw ratchev
On Sat, Feb 10, 2024, 03:06 Chet Ramey wrote: > On 2/3/24 3:29 PM, Casey Johnson wrote: > > > Bash Version: 5.1 > > Patch Level: 16 > > Release Status: release > > > > Description: > > > > The current implementation of the command history takes a long time to > load > > a large HISTFILE when hist

Re: Slow history load with some values of HISTSIZE

2024-02-05 Thread alex xmb sw ratchev
by > how long new terminals took to produce the first prompt. I started playing > around with different values and it wasn't hard to guess that there was a > whole lot of memmove() (or similar) happening. > -------------- > *From:* alex xmb sw ratchev > *Sent

Re: Slow history load with some values of HISTSIZE

2024-02-05 Thread alex xmb sw ratchev
On Mon, Feb 5, 2024, 18:09 Dale R. Worley wrote: > Casey Johnson writes: > > In a clean shell, execute: > > HISTFILE=alt-history.txt > > HISTSIZE=15 > > history -r > > and then observe how long the last command runs before returning. > > Though I e

  1   2   >