Ubuntu and Debian's shell are installed by default to dash, not bash.
Run the following command to view the details of SH and confirm which program the shell corresponds to:
$ls-al/bin/sh
Dash is lighter and faster than bash. But bash is more common.
If some commands, scripts, and so on are not always executed properly, it may be the cause of dash.
For example, when compiling the Android source code, if you use dash, it is possible to compile an error, or the compiled system will not start.
The shell can be switched back to bash in the following ways:
$sudo dpkg-reconfigure Dash
Then select No or no, and confirm.
Doing so will reconfigure dash and make it not the default shell tool.
You can also directly modify the/bin/sh link file and assign it to/bin/bash:
$sudo ln-fs/bin/bash/bin/sh
Another workaround is to specify the shell to be used directly in the script file, instead of specifying SH:
For example, use #!/bin/bash or #!/bin/dash instead of #!/bin/sh.
However, this will lose the versatility of the script so that it cannot be executed under a system that does not have the script specified.
SH Dash bash for Debian and Ubuntu