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

2023-11-09 Thread Oğuz
On Thursday, November 9, 2023, Steffen Nurpmeso wrote: > > I mean some scripting on "jobs | wc -l" would do that, though. :( > Maybe i should just write a function that builds the string > necessary to do what i wanted with %* or "%1-2 %4" etc. > Eh. Forget about it. > Can't you abuse jobs -x

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

2023-11-09 Thread Steffen Nurpmeso
Greg Wooledge wrote in : |On Thu, Nov 09, 2023 at 10:17:35PM +0100, Andreas Schwab wrote: |> On Nov 09 2023, Greg Wooledge wrote: |>> re='^\[([0-9]+)\]' .. |>> while IFS= read -r line; do |>> if [[ $line =~ $re ]]; then ... |> That fails for multi-line commands that happen

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

2023-11-09 Thread Steffen Nurpmeso
Robert Elz wrote in <15529.1699569...@jacaranda.noi.kre.to>: |Date:Thu, 9 Nov 2023 16:55:50 -0500 |From:Greg Wooledge |Message-ID: | || I believe *nothing* would work in that case; | |There's no requirement (in fact, it is probably not a good idea) for

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

2023-11-09 Thread Steffen Nurpmeso
Robert Elz wrote in <7989.1699564...@jacaranda.noi.kre.to>: |Date:Thu, 09 Nov 2023 21:04:28 +0100 |From:Steffen Nurpmeso |Message-ID: <20231109200428.8g9lz%stef...@sdaoden.eu> | || ash(1) and busybox ash(1) do not even support jobs -l in a function \ || (yet).

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

2023-11-09 Thread Steffen Nurpmeso
Andreas Schwab wrote in <87h6lueids@igel.home>: |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 Robert Elz
Date:Thu, 9 Nov 2023 16:55:50 -0500 From:Greg Wooledge Message-ID: | I believe *nothing* would work in that case; There's no requirement (in fact, it is probably not a good idea) for newlines in the output to be printed literally - whether entered literally or

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='^\[([0-9]+)\]' >> > > jobspecs=() >> > >

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 Greg Wooledge
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 > > jobspecs+=( "%${BASH_REMATCH[1]}" ) > > fi >

Bash-5.2 patch 21

2023-11-09 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-021 Bug-Reported-by:Norbert Lange Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-12/msg00046.html

Bash-5.2 patch 20

2023-11-09 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-020 Bug-Reported-by:Dima Korobskiy Bug-Reference-ID: <16664c2d-40ec-df33-b932-83db06e39...@gmail.com> Bug-Reference-URL:

Bash-5.2 patch 19

2023-11-09 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-019 Bug-Reported-by:Steffen Nurpmeso Bug-Reference-ID: <20230116233547.2jfxl%stef...@sdaoden.eu> Bug-Reference-URL:

Bash-5.2 patch 17

2023-11-09 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-017 Bug-Reported-by:Dan Church Bug-Reference-ID: <1a8fd1d6-a3ac-9a67-78eb-b9a743530...@gmx.com> Bug-Reference-URL:

Bash-5.2 patch 16

2023-11-09 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-016 Bug-Reported-by:F G Bug-Reference-ID: Bug-Reference-URL: Bug-Description: If an expression in an arithmetic for loop expands to NULL,

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 Robert Elz
Date:Thu, 09 Nov 2023 21:04:28 +0100 From:Steffen Nurpmeso Message-ID: <20231109200428.8g9lz%stef...@sdaoden.eu> | ash(1) and busybox ash(1) do not even support jobs -l in a function (yet). That seems unlikely, ash based shells mostly don't care whether the

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

2023-11-09 Thread Andreas Schwab
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 < <(jobs -l) That fails for multi-line commands that happen to contain

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

2023-11-09 Thread Steffen Nurpmeso
Greg Wooledge wrote in : |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 "%" $2}{next}')

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 >> |> awk regular expression where parts of the

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 expanded? ugh! what do i

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

2023-11-09 Thread Steffen Nurpmeso
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 expanded? ugh! what do i know??): | |awk -v var1='cont ent' -vv2="$other' ' { code } ' | |keep

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 Greg Wooledge
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 "%" $2}{next}') > echo $j > } Classic code injection

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

2023-11-09 Thread Steffen Nurpmeso
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>: || ... ||Something like this that would be, adding JLIST_SPEC_ONLY and

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 >> | <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: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: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread Steffen Nurpmeso
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. Just in case of interest. I mean some scripting on "jobs | wc -l"

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

2023-11-09 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20231109011212.tc9hj%stef...@sdaoden.eu>: ... Something like this that would be, adding JLIST_SPEC_ONLY and jobs(1) -j. Just in case of interest. diff --git a/builtins/jobs.def b/builtins/jobs.def index 1ce098d08b..989a78079e 100644 --- a/builtins/jobs.def +++

Re: posix command search and execution

2023-11-09 Thread Mike Jonkmans
On Thu, Nov 09, 2023 at 10:12:06PM +0700, Robert Elz wrote: > Date:Thu, 9 Nov 2023 14:21:35 +0100 > From:Mike Jonkmans > Message-ID: <20231109132135.ga208...@jonkmans.nl> > > | If I am not mistaken, for POSIX compliance, both /bin and /usr/bin have > | to be in

Re: posix command search and execution

2023-11-09 Thread Robert Elz
Date:Thu, 9 Nov 2023 14:21:35 +0100 From:Mike Jonkmans Message-ID: <20231109132135.ga208...@jonkmans.nl> | If I am not mistaken, for POSIX compliance, both /bin and /usr/bin have | to be in PATH (see quote from Robert). No, I didn't say that, there are no

Re: posix command search and execution

2023-11-09 Thread Mike Jonkmans
On Wed, Nov 08, 2023 at 10:42:20AM -0500, Chet Ramey wrote: > On 11/7/23 5:37 PM, Mike Jonkmans wrote: > > On Tue, Nov 07, 2023 at 11:49:25AM -0500, Chet Ramey wrote: > > > On 11/7/23 8:54 AM, Mike Jonkmans wrote: > > So the discussion is hidden. Hmm. > Not hidden; if you look at the open group's