bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Steffen Nurpmeso
Subject: Re: Idea: jobs(1) -i to print only :%ID:s
Date: Fri, 10 Nov 2023 00:12:06 +0100
User-agent: s-nail v14.9.24-563-g944131280a

Greg Wooledge wrote in
 <ZU1VZhrPyNQlxuBN@wooledge.org>:
 |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 to contain matches for
 |> re.
 |> 
 |> $ (sleep 100; printf $'\n[100]\n') &
 |
 |Fair enough.  I believe *nothing* would work in that case; the output of
 |"jobs -l" cannot be safely parsed in its current form.
 |
 |Adding a NUL-delimited output option might work around that, but if we're
 |modifying the jobs builtin, we might as well just add the -i or -j option
 |instead.

As i started this: it should simply quote it so that
"i=$(eval $x)" brings back the real value.  I use that excessively
for the mutilated shell capabilities of the MUA i maintain (am at
to at least improve that a bit for ie "eval set \$(($1+1))".).

 --End of <ZU1VZhrPyNQlxuBN@wooledge.org>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]