in reply to Environment discovery under Linux

In my experience, there are also situations where 'sh' is a "link to" or a "renameing of" 'bash'.

The fundamental problem is determining if whatever is the default shell; will it execute your problematic shell commands. First running a small test shell script designed to use the problematic statements alone, as a test.

If that works , regardless of what the shell is called, then your production shell will run as well.