Description of problem: /bin/sort uses the LC_ALL environment variable to determine how to sort. There seems to be a discrepency between how this variable is set in a user shell and cron's environment. This causes scripts to behave differently when run in a user shell vs. cron. Version-Release number of selected component (if applicable): vixie-cron-4.1-55.FC5 How reproducible: Every time Steps to Reproduce: 1. Place the following script in /etc/cron.hourly: #!/bin/sh sort << EOF > /tmp/1 a ab a- a-b a-a 2. Execute the script manually from a user shell and inspect /tmp/1. 3. Wait for cron to run the script and inspect /tmp/1. Actual results: cron: a a- a-a a-b * ab * user shell: a a- a-a ab * a-b * Expected results: The results should be the same whether the script is run by cron or from a user shell. Although one could manually set LC_ALL in the script, this requirement is not intuitive. From experience, coming to the proper conclusions while debugging an issue caused by this discrepency is quite difficult! Additional info: I am not sure if this should be fixed in cron or elsewhere.
Hello, cron set locale to system defaults or to that specified by any LC_* variable. Bash tracks the value of LC_ALL; used to override values for other locale categories. So it could work the same in my case, but it didn't. I'll look at it.
I close it as not a bug. Shell hasn't reason for using LC_* variables for sorting if you don't use locales. It isn't definitely problem of cron.