Get the script to echo the value of $LC_ALL. Looks like when it runs as you, it's in a Unicode locale (e.g. "en_us.UTF-8" with UTF-8 support) but when it runs under the scheduler it's in a legacy locale (probably "C") where U+202F (i.e., the bytes 0xE2 0x80 0xAF) appears as three unrelated top-bit-set characters.

If that's the issue, than you can force grep to use a proper locale by setting LC_ALL=en_us.UTF-8 yourself in your script.

Peter


Edited by peter (25/03/2024 07:43)