Re: [OT] of the merit of using awk for performance or who's got the fastest quote()

2017-05-19 Thread Thorsten Glaser
Stephane Chazelas dixit: >In mksh, printf is not built-in which doesn't help. In all but But in mksh, you just do this to quote: local foo set -A foo for x in "$@"; do foo+=("${x@Q}") done Or, probably faster: local foo nfoos=0 set -A foo for x in "$@"; do foo[nfoos++]=${x@Q}

Re: [OT] of the merit of using awk for performance or who's got the fastest quote() (Was: sh(1): is roundtripping of the positional parameter stack possible?)

2017-05-17 Thread Joerg Schilling
Stephane Chazelas wrote: > 2017-05-16 17:29:13 +0100, Stephane Chazelas: ... > szsh a 0.763 > szsh b 0.622 > ksh93 a 0.667 > ksh93 b 0.464 > yash a 0.738 > yash b 0.429 > > In mksh, printf is not built-in which doesn't help. In all but > ksh93, that still does 5

Re: [OT] of the merit of using awk for performance or who's got the fastest quote() (Was: sh(1): is roundtripping of the positional parameter stack possible?)

2017-05-17 Thread Robert Elz
Date:Tue, 16 May 2017 18:46:39 +0100 From:Stephane Chazelas Message-ID: <20170516174639.ga19...@chaz.gmail.com> | Actually, even for a handful of arguments, and even with gawk, | it seems it's generally quicker to use awk in my tests: