We spent some time to debug our script which ran perfectly locally. The problem was that the remote version was run by sh rather than by bash. 😭