Artificial intelligent assistant

Set default interpreter in fish shell I've installed `mill` on arch linux with fish as my default shell. Since the file `/usr/bin/mill` doesn't start with a shebang, fish won't execute the file. Instead it responds with $ mill Failed to execute process '/usr/bin/mill'. Reason: exec: Exec format error The file '/usr/bin/mill' is marked as an executable but could not be run by the operating system. I can execute mill with `bash -c 'mill'` but I don't want to be doing that all the time. Nor do I want to add that as an alias just for mill. Is it possible to configure fish to always use sh or bash when there isn't a shebang in the script instead of failing? Or maybe there is an operating system level problem? _edit:_ Mill is just an example. I've encountered this feature of fish numerous times with different scripts that I shouldn't be editing. That's why I'm looking for a way to forever avoid the feature not a one off fix for just mill.

You can't do that.

You can check its source code:


execve(actual_cmd, argv, envv);
err = errno;

// Something went wrong with execve, check for a ":", and run /bin/sh if encountered. This is a
// weird predecessor to the shebang that is still sometimes used since it is supported on
// Windows. OK to not use CLO_EXEC here because this is called after fork and the file is
// immediately closed.


Notice how its using `execve` (not `execvp` or `execlp`, which have a fall-back to `/bin/sh path` in case of `ENOEXEC`) and it will only run the script with `/bin/sh` if it starts with `:` (itself quite a dubious feature; especially since `fish` will also use it in the case of errors other than `ENOEXEC`).

But if you can edit the script to add a `:` at the beginning, you can just as well edit it to add a proper she-bang.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy dd708b636e428d4084f8254365e173ba