[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: |
Thu, 09 Nov 2023 23:56:36 +0100 |
User-agent: |
s-nail v14.9.24-563-g944131280a |
Andreas Schwab wrote in
<87h6lueids.fsf@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 < <(jobs -l)
|
|That fails for multi-line commands that happen to contain matches for
|re.
|
|$ (sleep 100; printf $'\n[100]\n') &
Bummer. Same is true for my thing.
Seems to me bash(1) should quote the output of jobs -l.
--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)
- Re: Idea: jobs(1) -i to print only :%ID:s, (continued)
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Andreas Schwab, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Greg Wooledge, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Robert Elz, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s,
Steffen Nurpmeso <=
- Re: Idea: jobs(1) -i to print only :%ID:s, Robert Elz, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, alex xmb sw ratchev, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Oğuz, 2023/11/09
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/10
- Re: Idea: jobs(1) -i to print only :%ID:s, Greg Wooledge, 2023/11/10
- Re: Idea: jobs(1) -i to print only :%ID:s, Steffen Nurpmeso, 2023/11/10