On an Ubuntu ($ uname -a
: Linux kumanaku 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
), I just installed fish ($ fish --version
: fish, version 2.7.1
) using the following commands :
sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update
sudo apt-get install fish
chsh -s /usr/bin/fish
echo /usr/bin/fish | sudo tee -a /etc/shells
I can launch fish
and use it but when I launch a simple shell file like :
echo "something"
I got the following message :
$ ./myscript.sh
Failed to execute process './myscript.sh'. Reason:
exec: Exec format error
The file './myscript.sh' is marked as an executable but could not be run by the operating system.
There's no shebang in my script. If I add #!/usr/bin/env fish
, everything's ok (i.e. the script is successfully launched) but I'd like to avoid such a line to keep my script compatible with different shells.
Any idea ?