Originally Posted By: tfabris
why it didn't work in the Synology Task Scheduler (but worked at the SSH prompt).


I'm going to guess that the Task Scheduler doesn't use /bin/bash, but uses /bin/sh, which is bash, but probably in a sh-compatible mode, with advanced bash features turned off.

Stop putting big hunks of script in the Task Scheduler dialog: put them in a script file (which can be properly versioned) and just call the script from Task Scheduler.

If you do that, you can use a bash shebang and get bash behaviour.
_________________________
-- roger