Re: printf, binary data, leading single quote and non ASCII codesets

2024-06-24 Thread Chet Ramey
On 6/24/24 7:36 AM, Gioele Barabucci wrote: Hi, bash manpage says for printf contains the following statement: if the leading character is a single or double quote, the value is the ASCII value of the following character. Thanks for the report. The man page should have been updated when I ch

Re: printf, binary data, leading single quote and non ASCII codesets

2024-06-24 Thread alex xmb sw ratchev
termux : printf "$b" | { while LC_ALL=C read -N1 c; do LC_ALL=C.UTF-8 printf "%d %q\n" "'$c" "$c"; done; } 255 ÿ 190 $'\276' On Mon, Jun 24, 2024, 1:37 PM Gioele Barabucci wrote: > Hi, > > bash manpage says for printf contains the following statement: > > > if the leading character is a si

Re: printf, binary data, leading single quote and non ASCII codesets

2024-06-24 Thread Oğuz
On Mon, Jun 24, 2024 at 2:37 PM Gioele Barabucci wrote: > $ printf -v b "\xc3\xbf\xbe" > > $ printf "$b" | { while LC_ALL=C read -N1 c; do \ > LC_ALL=C.UTF-8 printf "%d %q\n" "'$c" "$c"; done; } > 195 $'\303' > 255 $'\277' > 190 $'\276' Can't reproduce this on Ubuntu 22.04 with Bash 5.3-alph

printf, binary data, leading single quote and non ASCII codesets

2024-06-24 Thread Gioele Barabucci
Hi, bash manpage says for printf contains the following statement: if the leading character is a single or double quote, the value is the ASCII value of the following character. POSIX uses a different wording: If the leading character is a single-quote or double-quote, the value shall be th