Bash 5.2.32 printf format issues
by elMoco from LinuxQuestions.org on (#6PRYZ)
Hi,
Today, after updating my 'slackware-current' server I started having issues with some scripts, and I found out a problem with the new release of the bash package: the built-in printf command doesn't work with float numbers, while the previous version (5.2.26) was working fine:
Code:jesusm@liet:[~]$ bash --version
GNU bash, version 5.2.32(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
jesusm@liet:[~]$ printf "%f\n" 1.2
-nan
jesusm@liet:[~]$ /bin/printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$Code:jesusm@liet:[~]$ bash --version
GNU bash, version 5.2.26(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
jesusm@liet:[~]$ printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$ /bin/printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$For the time being I changed all my printf calls to /bin/printf
Today, after updating my 'slackware-current' server I started having issues with some scripts, and I found out a problem with the new release of the bash package: the built-in printf command doesn't work with float numbers, while the previous version (5.2.26) was working fine:
Code:jesusm@liet:[~]$ bash --version
GNU bash, version 5.2.32(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
jesusm@liet:[~]$ printf "%f\n" 1.2
-nan
jesusm@liet:[~]$ /bin/printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$Code:jesusm@liet:[~]$ bash --version
GNU bash, version 5.2.26(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
jesusm@liet:[~]$ printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$ /bin/printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$For the time being I changed all my printf calls to /bin/printf