On Sat, Jun 7, 2025, at 12:55 PM, Martin D Kealey wrote:
> However there might be some objections to relying on the printf built-in,
> since in theory Bash could be built without it, in which case I suggest:
>
> [...]
>
> +for (( m = n = argmax / ${#argmax} + 1 ; o = m & m-1 ; m = o )) do :; done
> +v=
> +for ((; m ; m >>= 1 )) do
> +    v+=$v
> +    (( n & m )) && v+=$argmax

It can also be built without arithmetic for loops and arithmetic
commands, so I don't think such objections would be reasonable.

-- 
vq

  • Re: exec3.sub nev... Martin D Kealey
    • Re: exec3.su... Joel Ebel via Bug reports for the GNU Bourne Again SHell
      • Re: exec... Chet Ramey
        • Re: ... Joel Ebel via Bug reports for the GNU Bourne Again SHell
          • ... Joel Ebel via Bug reports for the GNU Bourne Again SHell
            • ... Chet Ramey
              • ... Joel Ebel via Bug reports for the GNU Bourne Again SHell
              • ... Chet Ramey
              • ... Joel Ebel via Bug reports for the GNU Bourne Again SHell
              • ... Chet Ramey
    • Re: exec3.su... Lawrence Velázquez

Reply via email to