Why aren’t new terminals that use another language? It seems so antiquated getting errors for not writing the functions in the correct order among other things.

  • eyeballkid@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    3 years ago

    Shell scripts usually expect something POSIX-compatible, but you don’t have to stick with the default for user-facing tasks. Fish, zsh, powershell, and a whole bunch of niche shells are available to try. Anyhow, in the broad context of Unix default installations bash has a lot of competition.

    On several unix-like Oses more than one shell is used depending on context. A great interactive shell with loads of features may be overkill if you just want to execute a script. Some OSes don’t use bash at all.

    FreeBSD uses tcsh as its default root shell, but it uses ash shell (sh, it started as a clone of Bourne shell) for users and as the interpreter for system commands. This combo confused me at first and led me down a shell research rabbit-hole. ash is a stripped down shell that aims to be small, fast, and largely POSIX-compliant.

    In Ubuntu, bash is the default shell for interactive terminals, but dash is used to execute scripts by default. I think that dash started as a debian port of the ash shell.

    MacOS and Kali both use zsh as the default shell. I don’t know what they use by default to run scripts, but I would guess that it isn’t bash.

    Also, something that took me a while to figure out is that Bourne-Again Shell (bash) is not the same as Bourne Shell (sh). Further, sh does not always denote Bourne shell, but could be ash or dash or something else.