I have a script that needs to format numbers with thousands separators. So 12345671234567 becomes 1,234,5671,234,567. I use printf "%'d" 1234567printf "%'d" 1234567 to get the result. Works fine. Later in the script I set a custom IFS=","IFS="," to process a table of string pairs. If I then use the printf "%'d"printf "%'d" function I don't get commas, I get spaces instead. If I reset IFSIFS back to its default, then printfprintf behaves as expected.
Why is IFSIFS affecting the printf formating?