Best shell?

> mksh
+++ just werks
+ minimal
- no arithmetic for-loops

>bash
+ default pretty much everywhere
++ nice (csh-style) job control features
- bloat
- slow
- clunky

>zsh
++ good for interactive use
++ nice line editing
++ nice (csh-style) job control features
- bloat (more than bash)
- slow
- clunky

>dash
+ minimal
- sucks for interactive use
-- no parameter expansion by pattern substitution, i.e. no ${parameter/pattern/string}
- no arithmetic for-loops
-- buggy

>fish
++ good for interactive use
++ nice line editing
+ syntax highlighting.
- gigabloat
-- no here-documents
- not posix

>tcsh
+ good for interactive use
+++ nice job control features
-- no functions.
- not posix

>oksh
+++ public domain
+ minimal
-- no parameter expansion by pattern substitution, i.e. no ${parameter/pattern/string}
- no arithmetic for-loops

>ksh93
+++ most advanced language features
+ "I use Korn Shell, btw."
- somewhat old/clunky

>rc
+ minimal
+++ nice language
+ "I use rc, btw."
- somewhat old/clunky
- not posix

>pwsh
+ nice language.
- hypergigaomegabloat
- very slow
---- Micro$hit
----- telemetry
- not posix

Any others shells? Anything else I didn't consider?

It's All Fucked Shirt $22.14

The Kind of Tired That Sleep Won’t Fix Shirt $21.68

It's All Fucked Shirt $22.14

  1. 6 days ago
    Anonymous

    >Anything else I didn't consider?
    yash

  2. 6 days ago
    Anonymous

    bash dash shellcheck

    • 6 days ago
      Anonymous

      Last time I tried dash, it segfaulted when I tried to color to PS1 using ansi escape sequences.

      • 6 days ago
        Anonymous

        It's not meant to be an interactive shell you goober

        • 6 days ago
          Anonymous

          What the frick is the point of a non-interactive shell? Why not use either an interactive shell for your scripting anyway, or go all in on a more powerful interpreter like python or lua?

          • 6 days ago
            Anonymous

            >What the frick is the point of a non-interactive shell?
            Scripting.

            >Why not use...
            Posix compliance. The original usecase for dash was Debian wanting a faster shell script interpreter. Make a minimal default shell => all your installation/update/startup scripts are still guaranteed to run, but faster.

          • 6 days ago
            Anonymous

            Now that I'm thinking about that, it's a fairly odd goal. If you're running startup processes all the time and want them to go as fast as possible, a script interpreter is really just an inefficient solution.
            I think a better approach would be to have a script interface that's similar to what we're already familiar with. But then, the script is not just interpreted, but condensed down to byte- or machine code. On the next run, if the script hasn't been modified, the compiled version runs instead. The interpreter only needs to re-process the script if it gets modified, at which point it also replaces the compiled version. Which is more or less what Python does, but it could go further.

          • 6 days ago
            Anonymous

            I believe ksh93, at some point, had the ability to be compiled to bytecode. I almost listed it as a pro for that shell in my original post, but when I checked the man page I couldn't find anything about it. It might be a different version of the interpreter than what gets packaged in the Debian repos.

        • 6 days ago
          Anonymous

          It still shouldn't segfault when setting a variable. What other basic shell features cause it to crash?

          What the frick is the point of a non-interactive shell? Why not use either an interactive shell for your scripting anyway, or go all in on a more powerful interpreter like python or lua?

          >What the frick is the point of a non-interactive shell?
          Speed and portability, but yea I would use a normal scripting language for that to.

  3. 6 days ago
    Anonymous

    [...]

    How can I do this in oksh? It works in ksh93 and mksh.

    PS1="${LOGNAME}@${NAME}:${PWD/#'$home'/'~'}
    $ "

    • 6 days ago
      Anonymous

      I mean $HOME

    • 6 days ago
      Anonymous

      it's getting late here, but isn't that just
      PS1='u@h:w
      $ '

      • 6 days ago
        Anonymous

        Thanks, I didn't know you could do that. It doesn't work in any other variant of ksh that I've tried. I might consider using oksh after all.

        As far as I know, posix doesn't specify any special syntax for setting PS1, so different shells do it differently. I once tried to make a good portable PS1 variable. What I posted is a simplified version of what was my best attempt before giving up.

        I still wish oksh supported ${parameter/pattern/word}. Setting the PS1 variable is just one example of where it can be useful.

        • 6 days ago
          Anonymous

          Portability, especially for compat with shells that aren't installed by default on modern systems, is a meme. But you do you.

          • 6 days ago
            Anonymous

            I agree with you. As I said, I gave up.

  4. 6 days ago
    Anonymous

    >cmd/dos
    +++++cures your autism and paranoid pedophilia

  5. 6 days ago
    Anonymous

    My .bashrc
    python

  6. 6 days ago
    Anonymous

    busybox ash

  7. 6 days ago
    Anonymous

    eshell

    • 6 days ago
      Anonymous

      Thanks, I forgot to include this one. I tried it back when I was trying to learn Emacs. It was good but slow, and I thought it was annoying that C-p and C-n moved the cursor up and down instead of scrolling through the command history. I mostly gave up on Emacs when I couldn't figure out how to have a different configuration for the graphical and console version.

      • 6 days ago
        Anonymous

        I use evil mode. Not that I think modal is so super efficient and necessary, just the default emacs bindings are so bad that pretty much everything else is better. It's a super elegant editor. I love just writing down an elisp function and then directly evaluating and running it. No other environment lets you just extend things (and then also remove the extensions again) like this on the fly. It makes more sense to see emacs as a lisp VM which currency are text buffers, not an editor.

        • 6 days ago
          Anonymous

          The reason I ever wanted to use emacs was because of the default keys. I agree vi keys are objectively superior, but so many things on linux use emacs keys by default, that I thaught it would worth it to use them, just so things could be consistant everywhere. I've recently started using mg after trying emacs for a few months and after having used neovim for several years. I got sick of using C-p, C-n, C-e, and C-a because of muscle memory and having them do different things than what I expected in neovim.

          mg is really fast and supports most emacs commands. It annoyed me at first that mg doesn't have syntax highlighting, but I've gotten used to it. Programming without syntax highlighting sort of makes me feel like an authentic unix boomer. I think one of the the origional unix guys said that syntax highlighting was bad, anyway. I don't remember, but It might have been Rob Pike. I know acme and sam don't have syntax highlighting.

          I'm C-brained, so trying to configure emacs in lisp was a little difficult for me. One day I'd like to write my own clone of emacs using tcl instead of lisp.

          • 6 days ago
            Anonymous

            hoho tcl, now thats a name I haven't heard in a long time.

            What about lua? I feel it comes close in the elegance department, while being a lot faster. It's also very efficient, speed and resource wise.

          • 6 days ago
            Anonymous

            Lua is good as well. I think a couple emacs-like editors using lua already exist. GNU Micro comes to mind. But I like tcl because it seems more unixy to me, and I kind of romanticize it, because some of the best software ever written (sqlite, tk, etc.) was created for use with tcl.

            I think, other than the government making intellectual property laws apply to software, Richard Stallman rejecting tcl in favor of lisp as the extension language for gnu was probably the worst thing that ever happened to the tech ecosystem overall.

          • 6 days ago
            Anonymous

            > Richard Stallman rejecting tcl in favor of lisp as the extension language for gnu was probably the worst thing that ever happened to the tech ecosystem overall.
            why?

          • 6 days ago
            Anonymous

            I was being a hyperbolic, but as I said a lot of the best software ever written was created by the tcl "community," even if most of it is in C. From what I've heard Stallman's rejection pretty much killed tcl. If tcl were more popular, or even held the place Python curently holds today, things would be a lot better and less bloated. Many of the good things in the Python world are taken from the tcl world. They're just less well integrated. I learned Python in school and would have much preffered to have learned tcl. It's so much simpler and nicer.

            Also, I think things like Electron would be a lot less popular because tk would be there as a cross-platform gui. Most languages don't have gui features in their standard libraries. Third party gui libraries in most languages tend to be clunky and often have licensing issues. The only good cross platform gui solutions that exist are webshit and tcl/tk. I use the word, "good" relatively when reffering to webshit. I consider it to be a disaster that we are stuck with that crap.

            I wish tcl had been used as the scripting language of the web instead of Jabbashit as well.

          • 6 days ago
            Anonymous

            You're a little delusional. Python holds its place today because of its bloat, not in spite of it, and Electron is popular because the main target for most consumer software these days is the browser. You could argue that TCL could have captured the niche of computer nerds that like to tinker (e.g. Emacs enjoyers), but a single standard for anything runs counter to their very ethos.

            Basically, if TCL were more popular in the 80s, today it would be about as popular now Perl is.

          • 6 days ago
            Anonymous

            You're right. I'm just butthurt that there aren't any good ways to make bloat free gui's, and that we potentially missed out on a lot of good software that would have come out of the tcl space.

          • 6 days ago
            Anonymous

            how can you like tcl but hate its cousin

          • 6 days ago
            Anonymous

            If you're reffering to lisp, I don't hate it. I just don't think it ever had a chance to become popular because people don't like ~~*((*~~)), but tcl did have a chance and it would have made the tech world so much better.

  8. 6 days ago
    Anonymous

    >Any others shells? Anything else I didn't consider?
    nush

    • 6 days ago
      Anonymous

      Oh yea, I think I've heard of that one. Was it supposed to be like a non-micro$hit pwsh? I think I remember reading somewhere that it was new and not ready to be seriously used, but that might have been several years ago. Is that still the case?

      • 6 days ago
        Anonymous

        it breaks quite radically from bourne sh tradition.
        but it has become a lot more stable

  9. 6 days ago
    Anonymous

    zsh for interactive use
    dash for scripting, because it's fast and POSIX
    >But POSIX shell doesn't have arrays!
    If you need arrays for a script just use python

    • 6 days ago
      Anonymous

      so close to the perfect answer, then you fricked it up at the last word
      s/python/perl/

  10. 6 days ago
    Anonymous

    if you have to use the shell then the answer is fish unless you have a ricing complex then maybe zsh.

    • 6 days ago
      Anonymous

      I tried fish, but I had to drop it when I discovered that it didn't have here-docs. I use here-docs basically every time I use the shell.
      The design philosophy of fish seems to be similar to Python, "there's only one way to do it". Imo, it's better for an interactive shell to be like Perl, with lots of features, because everyone uses their computer for different things and will learn the subset of the features of the shell that are useful to them.
      It doesn't matter if an interactive shell is unreadable, because most of the time it's only used for single-use one-liners.
      The Python style philosophy is good if your just going to use the language for scripts, because it makes things more readable and more maintainable. But if you're just going to use it for scripts, and you're already sacrificing portability by making it non-posix, why not just use Python?

      • 6 days ago
        Anonymous

        >I use here-docs basically every time I use the shell
        lmao seriously?

        • 6 days ago
          Anonymous

          Yes, mostly for things like:
          dc <<.
          2 7 ^ p
          .

          I know "dc -e '2 7 ^ p' " also works, but there are a million interpreter commands that take input from the commandline using different flags (usually -e or -c, but sometimes others), and there are another million that won't take input from commandline argumens at all, so for me it's easier to just use here-docs.

  11. 6 days ago
    Anonymous

    it doesnt matter
    none of you will ever do anything that matters anyway

  12. 6 days ago
    Anonymous

    >linux
    all shit
    powershell on windows or gtfo

  13. 6 days ago
    Anonymous

    >bash
    >- bloat
    ?

  14. 6 days ago
    Anonymous

    [...]

    >function definition
    >command eval
    >- bloat
    ?

  15. 6 days ago
    Anonymous

    What are these icons from? Is there a license? I'd like to use them in a game

    • 6 days ago
      Anonymous

      The icons are from https://www.kenney.nl/. Everything there is in the public domain. I think there are a bunch of games on itch.io that use them.

      • 6 days ago
        Anonymous

        this guy is a beast, he makes so many free assets, they're great for throwing together prototypes and stuff

      • 6 days ago
        Anonymous

        Thank you!

  16. 6 days ago
    Anonymous

    Fish is just the best

  17. 6 days ago
    Anonymous

    scsh is the best shell

  18. 6 days ago
    Anonymous

    >- not posix
    not my problem
    you can afford to have bash and a good shell instead at the same time, right, anon?

    • 6 days ago
      Anonymous

      Not being posix isn't a deal breaker for me, but it's nice for things to be portable and just werk. At one point I was about ready to completely switch to tcsh, but its lack of functions made it impossible to port over a couple of things for the rc file, so I just had to stay with mksh, which is what I had been using before.

  19. 6 days ago
    Anonymous

    >calling any terminal slow
    are you a housefly or something? every terminal works in like the smallest fractions of a second

  20. 6 days ago
    Anonymous

    I just use bash. There's no point in using hipster macgay bullshit like zsh.

  21. 6 days ago
    OS MASTER

    made me own shell once, I did. T'weren't nuffin too fancy

  22. 6 days ago
    Anonymous

    On Linux, bash
    On Windows, powershell

    Stick to defaults and your scripts are much much much much much more portable

    • 6 days ago
      Anonymous

      This. Also, make sure you specify bash on your shebang. It's easy to use bashisms that won't be compatible with a true borne shell.

  23. 6 days ago
    Anonymous

    WTF is speed even a criteria for shells? They are for automating a few trivial tasks, not for complicated work.

    • 6 days ago
      Anonymous

      When I made reference to the slowness of a shell, I was not talking about the speed of execution. I was talking about the feeling of snappiness/sluggishness when using the shell interactively. On my ancient potato computer with an i5 from 2013, some of the more bloated shells, like bash and zsh, will sometimes hang for half a second when trying to scroll up through my command history, something I've never experienced using any variant of ksh.

Your email address will not be published. Required fields are marked *