we use unix modules and have sh softlinked to bash in system.
$ ls -al /bin/sh lrwxrwxrwx 1 root root 4 Jan 27 2016 /bin/sh -> bash I thought it should be the same use #!/bin/sh & #!/bin/bash, but it is different.
For example, we have bash_completion script
$ cat bash_completion _module_not_yet_loaded() { comm -23 <(_module_avail|sort) <(tr : '\n' <<<${LOADEDMODULES}|sort) } I try to initialize this
$ bash $ source bash_completion $ sh # switch to sh $ source bash_completion sh: bash_completion: line 3: syntax error near unexpected token `(' sh: bash_completion: line 3: ` comm -23 <(_module_avail|sort) <(tr : '\n' <<<${LOADEDMODULES}|sort)' So what's the problem ? why sh softlink to bash doesn't work as I expected ?
shand enables sh-compatibility.#!/bin/shfile. See this answer.shif you want to use<(…).