printf command inside a script returns "invalid number"
This:
LC_NUMERIC="en_US.UTF-8" printf %e 14.9
sets $LC_NUMERIC
only for the duration of that one command.
This:
export LC_NUMERIC="en_US.UTF-8"
sets $LC_NUMERIC
only for the duration of the current shell process.
If you add
export LC_NUMERIC="en_US.UTF-8"
to your $HOME/.bashrc
or $HOME/.bash_profile
, it will set $LC_NUMERIC
for all bash shells you launch.
Look for existing code that sets $LC_NUMERIC
in your .bashrc
or other shell startup files.