Re: printf width format specifier doesn't work when assigned

2025-01-26 Thread Greg Wooledge
On Sun, Jan 26, 2025 at 11:16:27 +0100, Phi Debian wrote: > $ printf -v foo "%(*)T" {1..4} ; echo "'$foo'" > '' I've added this one to .

Re: printf width format specifier doesn't work when assigned

2025-01-26 Thread Phi Debian
On Sat, Jan 25, 2025 at 4:06 PM Andreas Kähäri wrote: > > Sorry, I pressed send too quickly. I was going to suggest an alternative > to using a command substitution and tr: > > printf -v foo '%*s' 80 ' ' > echo "${foo// /*}" > > -- > Andreas (Kusalananda) Kähäri > Uppsala, Sweden

Re: printf width format specifier doesn't work when assigned

2025-01-25 Thread Greg Wooledge
On Sat, Jan 25, 2025 at 15:56:39 +0100, Andreas Kähäri wrote: > Je Sat, Jan 25, 2025 at 07:16:14AM +, Ross skribis: > > However: > > foo=$(printf "%*s\n" 80 " " | tr " " "*") > > echo $foo > > acts very differently; it seems to perform ls or something similar. > This is no bug in bash

Re: printf width format specifier doesn't work when assigned

2025-01-25 Thread Andreas Kähäri
Je Sat, Jan 25, 2025 at 03:56:42PM +0100, Kusalananda Kähäri skribis: > Je Sat, Jan 25, 2025 at 07:16:14AM +, Ross skribis: > > > > Configuration Information [Automatically generated, do not change]: > > Machine: x86_64 > > OS: linux-gnu > > Compiler: gcc > > Compilation CFLAGS: -g -O2 -fno-om

Re: printf width format specifier doesn't work when assigned

2025-01-25 Thread Andreas Kähäri
Je Sat, Jan 25, 2025 at 07:16:14AM +, Ross skribis: > > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 -fno-omit-frame-pointer -mno-omit-leaf- > frame-pointer -flto=auto -ffat-lto-objects -fstac

Re: printf width format specifier doesn't work when assigned

2025-01-25 Thread microsuxx
the \* to * works also leftover of testing .. needs set -f On Sat, Jan 25, 2025, 3:34 PM microsuxx wrote: > ~ $ set -f > ~ $ foo=$(printf "%*s\n" 80 " " | tr " " "*") ; echo $foo > > > > ~ $ printf -v v '%*s' 200 '

Re: printf width format specifier doesn't work when assigned

2025-01-25 Thread microsuxx
~ $ set -f ~ $ foo=$(printf "%*s\n" 80 " " | tr " " "*") ; echo $foo ~ $ printf -v v '%*s' 200 ' ' ; v=${v// /\*} ; echo $v *