File indexing completed on 2026-04-09 07:49:15
0001
0002
0003 usage(){ cat << EOU
0004
0005 ~/opticks/sysrap/tests/s_locale_test.sh
0006
0007
0008 epsilon:tests blyth$ LC_ALL=C ~/opticks/sysrap/tests/s_locale_test.sh run
0009 1000000000
0010 1000000000
0011 epsilon:tests blyth$ LC_ALL=POSIX ~/opticks/sysrap/tests/s_locale_test.sh run
0012 1000000000
0013 1000000000
0014 epsilon:tests blyth$ LC_ALL=en_US ~/opticks/sysrap/tests/s_locale_test.sh run
0015 1,000,000,000
0016 1,000,000,000
0017 epsilon:tests blyth$ LC_ALL=en_GB ~/opticks/sysrap/tests/s_locale_test.sh run
0018 1,000,000,000
0019 1,000,000,000
0020 epsilon:tests blyth$ LC_ALL=en_GB.UTF-8 ~/opticks/sysrap/tests/s_locale_test.sh run
0021 1,000,000,000
0022 1,000,000,000
0023 epsilon:tests blyth$
0024
0025
0026 Background info on locale
0027
0028 * https://www.ibm.com/docs/en/aix/7.1?topic=locales-understanding-locale-environment-variables
0029
0030
0031
0032 EOU
0033 }
0034
0035
0036 defarg="info_build_run"
0037 arg=${1:-$defarg}
0038
0039 name=s_locale_test
0040 FOLD=/tmp/$name
0041 mkdir -p $FOLD
0042
0043 bin=$FOLD/$name
0044
0045
0046 vars="0 defarg arg name FOLD bin"
0047
0048 if [ "${arg/info}" != "$arg" ]; then
0049 for var in $vars ; do printf "%20s : %s \n" "$var" "${!var}" ; done
0050 fi
0051
0052 if [ "${arg/build}" != "$arg" ]; then
0053 gcc $name.cc \
0054 -std=c++11 -lstdc++ \
0055 -I.. \
0056 -o $bin
0057 [ $? -ne 0 ] && echo $BASH_SOURCE compile error && exit 1
0058 fi
0059
0060 if [ "${arg/run}" != "$arg" ]; then
0061 $bin
0062 [ $? -ne 0 ] && echo $BASH_SOURCE run error && exit 2
0063 fi
0064
0065 exit 0
0066
0067