The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
63 views

Can I have a conditional shebang?

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: ...
1
vote
1answer
109 views

How to restore “.sh” association in bash?

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 ...
2
votes
1answer
33 views

Are shebang invocations detectable?

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 ...
0
votes
2answers
241 views

Shebangs do not like sudo in OSX

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 ...
2
votes
1answer
183 views

#! (shebang) line length limitation

In connection with developing GNU Parallel I seem to have hit a limit in the length of #! (shebang). This shebang-line: #!/bin/echo ...