I have a script that can be run with different interpreters: #!/usr/bin/env default-interpreter [my script] But I would like to use an alternative-interpreter if it's available, like this: ...
For some unknown reason I have a Debian 7 VM where .sh files that don't have a shebang line (#!/bin/sh) are no longer associated/executed by bash, ie. under bash, with "test.sh" an executable shell ...
Is there a way for a bash script to detect if it's being run via the #!/usr/bin/env shebang? Some magic bash foo that would let me write: #!/bin/bash ... if [ __INVOKED_VIA_USR_BIN_ENV__ ]; then ...
Using sudo in the shebang seems completely broken. The following code: #!/usr/bin/sudo /bin/bash echo "this should work" works fine on Ubuntu, but on OSX gives me: sudo: effective uid is not 0, is ...
In connection with developing GNU Parallel I seem to have hit a limit in the length of #! (shebang). This shebang-line: #!/bin/echo ...