I’m moving my posts from Reddit to Lemmy before delete them.

This post is from 2020-09-03.

  • @[email protected]
    link
    fedilink
    English
    211 year ago

    Okay, you guys get the once in a liftetime chance to convince me that Bash is not the way to go. I’ll eagerly await your proposals.

    • @likeaduck
      link
      English
      28
      edit-2
      1 year ago

      deleted by creator

      • @[email protected]
        link
        fedilink
        English
        61 year ago

        Automatic cd: Zsh simplifies directory navigation by enabling users to change directories simply by typing the name of the desired directory. This feature eliminates the need to type the “cd” command explicitly, saving time and keystrokes.

        What if there happens to be a command with the same name?

        • @Still
          link
          English
          71 year ago

          command goes first

          order is shell built in > path > autocd

          • @[email protected]
            link
            fedilink
            English
            91 year ago

            Then you’re likely to enter a command by accident. I would consider that a dangerous misfeature and look to turn it off.

            • @Still
              link
              English
              41 year ago

              not really tab complete puts a / at the end of autocd directories

              • @[email protected]
                link
                fedilink
                English
                41 year ago

                Can you not type in the name of the hazardous folder yourself? I’m envisioning trying to autocd into a folder named reboot or something.

                • @Still
                  link
                  English
                  11 year ago

                  then you would type reboot/

            • Gamma
              link
              English
              31 year ago

              I’ve got syntax highlighting enabked, so I always notice the different color when I type a commnand.

          • @[email protected]
            link
            fedilink
            English
            21 year ago

            Until I forget about some command or another, and accidentally give a folder the same name.

      • @[email protected]
        link
        fedilink
        English
        41 year ago

        Some of those options exist in Bash too, but need to be enabled in your profile: https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html. Bash is also more like to be available on random machines that you have access to. Lastly, if you’re working a lot with Bash scripts in your (work) environment you might feel more at home using Bash in interactive mode too.

        Those are just some counter arguments for the sake of completeness. I think zsh is great, even though I personally don’t use it (yet).

        • Gamma
          link
          English
          21 year ago

          Yeah, from the first line

          Zsh, an extended version of the Bourne Shell (sh)

          This screams AI-generated.

      • @[email protected]
        link
        fedilink
        English
        11 year ago

        Automatic cd isnt a zsh-only feature. You can use it in bash by shopt -s autocd. Afaik its also disabled by default in zsh, just enabled by oh-my-zsh.

    • Gamma
      link
      English
      6
      edit-2
      1 year ago

      There are two massive points no one has mentioned yet.

      • Quoting every expansion isn’t necessary in Zsh. Parameters don’t split or glob by default.
      • $array actually expands to every element in an array.

      Compare this between Bash and Zsh:

      a=('/* hello */' 'world!' '  ')
      printf '"%s" ' $a
      
      • @[email protected]
        link
        fedilink
        English
        4
        edit-2
        1 year ago

        $array actually expands to every element in an array.

        Very convenient. But ~every shell script is written in bash or POSIX(y) sh. When I need to write shell scripts I begin with busybox sh compability. If it turns out to be too complex, I’ll convert to bash. This is because if I ever would publish the script it would have better changes to be accepted as a PR for example. Yes. Bash is a mess. I don’t even like it that much. It’s okay. But it’s more standard then zsh. Although I’ve seen the tides turn on some occasions, like macOS.

        Maybe some day I’ll give zsh a second chance.

        • Gamma
          link
          English
          21 year ago

          I used to write Bash more than anything, but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.

          • @[email protected]
            link
            fedilink
            English
            11 year ago

            but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.

            Well said!

    • @muhybOP
      link
      English
      41 year ago

      Bash is the way, zsh if you are lazy.