I’m an avid bash user for the same fear of incompatibility. But how does that work in practice? I mean- if I use Fish shell interactiveley, how does that affect shell scripts? I presume they would still be run via bash (#!/bin/bash)
Executing programs (including scripts, which are indicated by shebangs like #! /bin/bash) is the operating system's responsibility, not the shell's.
So yeah, shell scripts work exactly the same if you're running them as an executable. Some scripts, however, (like for instance .bashrc) are intended to be sourced by the shell rather than invoked as an independent executable. These won't work, and will need to be ported.
Comments
I’m an avid bash user for the same fear of incompatibility. But how does that work in practice? I mean- if I use Fish shell interactiveley, how does that affect shell scripts? I presume they would still be run via bash (#!/bin/bash)
Executing programs (including scripts, which are indicated by shebangs like #! /bin/bash) is the operating system's responsibility, not the shell's.
So yeah, shell scripts work exactly the same if you're running them as an executable. Some scripts, however, (like for instance .bashrc) are intended to be sourced by the shell rather than invoked as an independent executable. These won't work, and will need to be ported.
Could be "add source /blah blah" to your bashrc, and this adds some shell functions (which allow it to do stuff like cd).
Every script should have a #! line, but if it doesn't, you can always run it with `bash <script>`.