On Tue, Mar 21, 2023, 21:05 Grisha Levit <grishale...@gmail.com> wrote:
> On Tue, Mar 21, 2023 at 3:47 PM Chet Ramey <chet.ra...@case.edu> wrote: > > OK, say you did in fact run compgen in the foreground -- very unusual > > because it's awkward to capture the possible completions that way -- to > > generate completions. > > Sorry I should have explained. I hit this issue because I was using > compgen in an unorthodox way, just to check if some files matching a > glob exist. Basically something like > > compgen -G 'foo/*' >/dev/null && COMPREPLY=(bar) > > This can be a lot faster than expanding the glob into an array and > then testing that the array is not empty. > i do , with nullglob etc IFS=\| meta=${*@Q} IFS=$' \t\n' declare -a "paths=( @($meta) )" set -- "${paths[@]}" >