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' 'two' 'three' > ~ $ > &

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() { printf '%(%F+%T%z)T %s' -1 "$1" >>"

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

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:

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

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

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

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 t

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

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

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

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

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

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

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

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

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

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
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: > >> >> >> On Mon, Mar 11, 2024, 22:36 alex xmb sw ratch

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 &" > me[$!]=$ru

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

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
24, 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 run is > than thre

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 at 7:25 PM alex

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;

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

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

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

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

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

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

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:* Mo

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

Re: wait -n misses signaled subprocess

2024-02-01 Thread alex xmb sw ratchev
On Thu, Feb 1, 2024, 09:09 alex xmb sw ratchev wrote: > > > On Wed, Jan 31, 2024, 20:36 Robert Elz wrote: > >> Date:Wed, 31 Jan 2024 11:35:57 -0500 >> From:Chet Ramey >> Message-ID: <1e50aa99-8d53-4cdf-ba5e-6aaf3ccc6...@ca

Re: wait -n misses signaled subprocess

2024-02-01 Thread alex xmb sw ratchev
On Wed, Jan 31, 2024, 20:36 Robert Elz wrote: > Date:Wed, 31 Jan 2024 11:35:57 -0500 > From:Chet Ramey > Message-ID: <1e50aa99-8d53-4cdf-ba5e-6aaf3ccc6...@case.edu> > > | Not quite. `new' in this sense is the opposite of `anything in the > past' > | as Dale

Re: Path of exported variable not set as source

2024-01-26 Thread alex xmb sw ratchev
On Fri, Jan 26, 2024, 14:29 Ricky Tigg wrote: > BASH version: 5.2.26(1)-release. OS: Fedora; Desktop edition. > > Hello. > > Current state: Vim set as default text editor. > > $ cat .bashrc | grep '^export EDITOR' > export EDITOR='/usr/bin/vim' > $ typeset -p EDITOR > declare -x

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-15 Thread alex xmb sw ratchev
On Mon, Jan 15, 2024, 19:03 Chet Ramey wrote: > On 1/11/24 7:29 PM, Ángel wrote: > > On 2024-01-11 at 09:29 -0500, Chet Ramey wrote: > >> On 1/11/24 2:37 AM, ilya Basin wrote: > >>> Dear. > >>> I needed to read 16 bytes from a binary file and tried to replace a > >> hexdump call with read

Re: completion very slow with gigantic list

2024-01-11 Thread alex xmb sw ratchev
On Thu, Jan 11, 2024, 23:21 Chet Ramey wrote: > On 1/10/24 12:28 AM, Eric Wong wrote: > > Hi, I noticed bash struggles with gigantic completion lists > > (100k items of ~70 chars each) > > > > It's reproducible with both LANG+LC_ALL set to en_US.UTF-8 and C, > > so it's not just locales slowing

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-11 Thread alex xmb sw ratchev
On Thu, Jan 11, 2024, 15:29 Chet Ramey wrote: > On 1/11/24 2:37 AM, ilya Basin wrote: > > Dear. > > I needed to read 16 bytes from a binary file and tried to replace a > hexdump call with read built-in. I expected that with "-N1" if a NUL > character is encountered bash would assign an empty

Re: Multi-line PS1 color disappearance problem

2023-12-21 Thread alex xmb sw ratchev
On Thu, Dec 21, 2023, 18:26 email--- 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: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt > -fexceptions

Re: Newlines resulting from alias expansion are ignored by here-document processing

2023-12-05 Thread alex xmb sw ratchev
On Tue, Dec 5, 2023, 17:22 Chet Ramey wrote: > On 11/30/23 3:45 AM, gldrk wrote: > > $ cat test > > alias 'foo=cat < > hello' > > foo > > world > > EOF > > $ sh test > > world > > test: line 5: hello: command not found > > > > My reading of the upcoming POSIX revision > >

Re: unreliable value of LINENO variable

2023-12-04 Thread alex xmb sw ratchev
i ve experienced many ghost fails .. got better over time and knowerledge greets On Mon, Dec 4, 2023, 18:21 Chet Ramey wrote: > On 12/4/23 8:46 AM, Giacomo Comes wrote: > > I use often the value of LINEO in order > > to know where to look for issues in a script. > > Recently I discovered a

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 11:08 PM alex xmb sw ratchev wrote: > > > On Thu, Nov 9, 2023, 10:56 PM Greg Wooledge wrote: > >> On Thu, Nov 09, 2023 at 10:17:35PM +0100, Andreas Schwab wrote: >> > On Nov 09 2023, Greg Wooledge wrote: >> > >> >

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 10:56 PM Greg Wooledge wrote: > On Thu, Nov 09, 2023 at 10:17:35PM +0100, Andreas Schwab wrote: > > On Nov 09 2023, Greg Wooledge wrote: > > > > > re='^\[([0-9]+)\]' > > > jobspecs=() > > > while IFS= read -r line; do > > > if [[ $line =~ $re ]]; then > >

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 10:18 PM Andreas Schwab wrote: > On Nov 09 2023, Greg Wooledge wrote: > > > re='^\[([0-9]+)\]' > > jobspecs=() > > while IFS= read -r line; do > > if [[ $line =~ $re ]]; then > > jobspecs+=( "%${BASH_REMATCH[1]}" ) > > fi > > done

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 8:24 PM Greg Wooledge wrote: > On Thu, Nov 09, 2023 at 08:09:23PM +0100, Steffen Nurpmeso wrote: > > j() { > > local j= a=${AWK:-awk} > > [ $# -gt 0 ] && j='&& $2 !~ /(^| )('$(echo "$@" | tr ' ' '|')')( > |$)/' > > j=$(jobs -l | $a -F '[][]' '/^[[]/'"$j"'{print

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 8:41 PM alex xmb sw ratchev wrote: > > > On Thu, Nov 9, 2023, 8:36 PM Steffen Nurpmeso wrote: > >> alex xmb sw ratchev wrote in >> : >> ... >> |> So i did that (what a mess -- does anyone know how i can create an &g

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 8:36 PM Steffen Nurpmeso wrote: > alex xmb sw ratchev wrote in > : > ... > |> So i did that (what a mess -- does anyone know how i can create an > |> awk regular expression where parts of the expression is a variable > |> that should be expa

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 8:10 PM Steffen Nurpmeso wrote: > Steffen Nurpmeso wrote in > <20231109181645.bocyg%stef...@sdaoden.eu>: > |Steffen Nurpmeso wrote in > | <20231109181107.bj0wl%stef...@sdaoden.eu>: > ||Steffen Nurpmeso wrote in > || <20231109011212.tc9hj%stef...@sdaoden.eu>: > || ... >

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 7:21 PM alex xmb sw ratchev wrote: > > > On Thu, Nov 9, 2023, 7:17 PM Steffen Nurpmeso wrote: > >> Steffen Nurpmeso wrote in >> <20231109181107.bj0wl%stef...@sdaoden.eu>: >> |Steffen Nurpmeso wrote in >>

Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread alex xmb sw ratchev
On Thu, Nov 9, 2023, 7:17 PM Steffen Nurpmeso wrote: > Steffen Nurpmeso wrote in > <20231109181107.bj0wl%stef...@sdaoden.eu>: > |Steffen Nurpmeso wrote in > | <20231109011212.tc9hj%stef...@sdaoden.eu>: > | ... > |Something like this that would be, adding JLIST_SPEC_ONLY and > |jobs(1) -j.

Re: Strange results

2023-10-26 Thread alex xmb sw ratchev
On Thu, Oct 26, 2023, 9:07 PM Victor Pasko wrote: > -- Forwarded message - > From: Victor Pasko > Date: Fri, Oct 27, 2023 at 1:57 AM > Subject: Re: Strange results > To: Dennis Williamson > > > > Also > > echo10 ${ASCII_SET:$((-10)):1} > > and > > echo11 ${ASCII_SET:-10:1} > >

Re: wrong variable name in error message about unbound variable?

2023-10-19 Thread alex xmb sw ratchev
On Thu, Oct 19, 2023, 16:58 Chet Ramey wrote: > On 10/17/23 3:32 PM, Grisha Levit wrote: > > > The reason is that if there was no variable found prior to expanding > > the subscript, bash does not check to see if one was created during > > that process. > > Thanks, I'll consider it. Behavior

Re: bash tries to parse comsub in quoted PE pattern

2023-10-18 Thread alex xmb sw ratchev
On Wed, Oct 18, 2023, 14:20 Zachary Santer wrote: > On Tue, Oct 17, 2023 at 5:56 PM Emanuele Torre > wrote: > > > bash-5.1$ letters=( {a..z} ); echo "${letters["{10..15}"]}" > > k l m n o p > > > > Then there's the question "Was that even supposed to work like that?" If > so, you'd

Re: wrong variable name in error message about unbound variable?

2023-10-17 Thread alex xmb sw ratchev
On Tue, Oct 17, 2023, 16:30 Chet Ramey wrote: > On 10/17/23 8:43 AM, Zachary Santer wrote: > > On Tue, Oct 17, 2023 at 8:00 AM Greg Wooledge wrote: > > > >> unicorn:~$ unset -v a b c array > >> unicorn:~$ a=b b=c c=42 array[a]=foo; declare -p array > >> declare -a

Re: wrong variable name in error message about unbound variable?

2023-10-17 Thread alex xmb sw ratchev
On Tue, Oct 17, 2023, 15:09 Zachary Santer wrote: > On Tue, Oct 17, 2023 at 8:43 AM Zachary Santer wrote: > > > On Tue, Oct 17, 2023 at 8:00 AM Greg Wooledge wrote: > > > >> unicorn:~$ unset -v a b c array > >> unicorn:~$ a=b b=c c=42 array[a]=foo; declare -p array > >> declare -a