Which shells do you guys tend to use the most?

I’ve been trying to get into fish lately, have also used xonsh because I’m really comfortable with python so why not use that instead of bash and just inject subshells into my python scripts

  • hello_hello [undecided, comrade/them]@hexbear.net
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    7 months ago

    GNU Bash + GNU Emacs (an interactive shell to a running elisp interpreter)

    Since I contribute to NixOS, our builder expressions are in Bash so it helps to be familiar with it. Elisp is always fun to hack on.

    I don’t really get the shell hype. Especially with Fish since it can’t be used as a POSIX compliant login shell. Zsh to me has always been the “apple shell”

    Still waiting for the GNU bash release that finally complies with XDG and I can throw that .bashrc out of $HOME

    • invalidusernamelol [he/him]@hexbear.netOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 months ago

      It’s so irritating that all these shells aren’t POSIX compliant, and some in really stupid ways.

      There is some utility in them, but for now they’re relegated to the “hey, I’m just gonna use these when I have a very specific small task that they could make a bit easier” or “I wanna spend this week writing bash, but not correctly and kinda buggy”

      Of all of them, Xonsh has the most actual utility since it’s literally just a python repl that lets you assign subshell output directly to python variables.

      def touch_files(x: int, name: str) -> list[str]:
          return [$(touch $n_$name) or f'{n}_{name} for n in range(x)]
      
      @ readmes = touch_files(10, "readme")
      @ ls
      0_readme
      1_readme
      ...
      @ for r in readmes:
          print(r)
      0_readme
      1_readme
      ...
      

      That being said, it’s also a python interpreter and if you install it in the system environment, be ready for your shell to break when your system python changes version. Which is definitely not POSIX compliant lol.

      So yeah, from my adventures in the shell space over the past couple weeks, I can say I agree with you that just sticking with plain old bash is best, followed by dash or zsh if you really just don’t want to use a bash shell. Anything else should be considered an application that runs in your bash shell.

    • invalidusernamelol [he/him]@hexbear.netOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

      Just tried it out and it’s cool, but zsh doesn’t play well with most ttys when you mess with the prompts like that.

      Did lead me down a rabbit hole to oh-my-bash though which is pretty nice and runs on regular bash. Even has a powerbash10k theme lol.

      Also found ble.sh which adds syntax highlighting and fish/zsh style atocomplete to a bash shell (written in pure bash). It’s slow as turds so I just aliased it to make it easy to enable/disable.

      Looks like I’m sticking to bash lol

    • invalidusernamelol [he/him]@hexbear.netOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

      Any major issues besides having to change shebangs from #!/usr/bin/sh to #!/usr/bin/env bash for existing scripts? I’m still not sure I totally get the fish language, it’s close enough to bash that I keep wanting to do bash, but different enough that nothing works and I get fun errors lol