[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: efficient way to use matched string in variable substitution
From: |
Mike Jonkmans |
Subject: |
Re: efficient way to use matched string in variable substitution |
Date: |
Tue, 24 Aug 2021 16:41:46 +0200 |
On Tue, Aug 24, 2021 at 09:24:35AM -0400, Greg Wooledge wrote:
> On Tue, Aug 24, 2021 at 03:09:55PM +0200, Mike Jonkmans wrote:
> > This seems to be the fastest:
> > f12 () { [[ "$1" =~ ${1//?/(.)} ]]; local arr=( "${BASH_REMATCH[@]:1}" ); }
> > time for ((i=1; i<=10000; i++)); do f0 682390; done
> > real 0m0,296s
> > user 0m0,296s
> > sys 0m0,000s
>
> Your CPU is a bit faster than mine, since none of mine (nor yours) go
> quite that fast on my computer, but you've written "f0" in your time
> command, not f12.
oh oh, last minute edit - because i wasn't sure at which fN you started :)
- efficient way to use matched string in variable substitution, L A Walsh, 2021/08/23
- Re: efficient way to use matched string in variable substitution, Greg Wooledge, 2021/08/23
- Re: efficient way to use matched string in variable substitution, L A Walsh, 2021/08/23
- Re: efficient way to use matched string in variable substitution, Greg Wooledge, 2021/08/23
- Re: efficient way to use matched string in variable substitution, Léa Gris, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Greg Wooledge, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Léa Gris, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Mike Jonkmans, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Greg Wooledge, 2021/08/24
- Re: efficient way to use matched string in variable substitution,
Mike Jonkmans <=
- Re: efficient way to use matched string in variable substitution, Léa Gris, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Greg Wooledge, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Mike Jonkmans, 2021/08/24
- Re: efficient way to use matched string in variable substitution, L A Walsh, 2021/08/24
- Re: efficient way to use matched string in variable substitution, Koichi Murase, 2021/08/24
Re: efficient way to use matched string in variable substitution, Oğuz, 2021/08/23