Here is a script to reproduce this scenario: $ printf '\xEF\xBB\xBF#!/bin/bash\necho hi\n' > /tmp/x.sh $ chmod +x /tmp/x.sh $ bash -c /tmp/x.sh /tmp/x.sh: line 1:_#!/bin/bash: No such file or directory hi
Here is a script to reproduce this scenario: $ printf '\xEF\xBB\xBF#!/bin/bash\necho hi\n' > /tmp/x.sh $ chmod +x /tmp/x.sh $ bash -c /tmp/x.sh /tmp/x.sh: line 1:_#!/bin/bash: No such file or directory hi