• dylanmorgan@slrpnk.net
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    This may be the wrong place to ask, but what am I missing about shells? Other than executing commands, what do you do with them?

    • TiphaineRupa@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      10 months ago

      Many Linux users spend a considerable amount of time using the command line interface, so the right shell configuration can make them much more productive.

    • hallettj@beehaw.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      I think the best way to get an idea is to look at feature lists for fancy shells like zsh or fish. But in short there are a number of things a good shell can do to help to execute commands faster and more easily. Stuff like autocompletions which make you faster, and also make things more discoverable; fuzzy searching/matching; navigating command history; syntax highlighting which helps to spot errors, and helps to understand the syntax of the command you’re writing.

      • Tin@beehaw.org
        link
        fedilink
        arrow-up
        3
        ·
        9 months ago

        I use fish mainly just for the quality of life increase that its predictive features and command history give. I also really like that it uses functions to play the role of aliases, and it’s super easy to write and save new functions on the fly.

        That said… I haven’t put in the time to really learn its nuances and I still write shell scripts using bash. Maybe I’m doing it wrong, but it works for me.

    • SWW13@lemmy.brief.guru
      link
      fedilink
      arrow-up
      0
      ·
      10 months ago

      You can do most things by combining simple cmdline tools. E.g. filter out some specific lines from all files in a directory, get the value after the second :, write those to another file and then sort, deduplicate and count them.

      This may sound complicated, but it’s pretty easy and fast if your are familiar with a shell. To be that efficient with your shell you want it to actually be powerful and not just a plain text input. Also writing cmdline tools is rather easy compared to a usable GUI tool.

      • smeg@feddit.uk
        link
        fedilink
        English
        arrow-up
        0
        ·
        10 months ago

        Genuine question: why not use grep, awk, sed, or any of the other gnu tools that can already do that?

        • SWW13@lemmy.brief.guru
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          That’s what I meant, using your shell to run command line tools to solve your issue at hand. And having a powerful shell with e.g. context dependend autocomplete (and a lot more) helps to speed up that task.

  • hallettj@beehaw.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    Well I might be hooked. It didn’t take me long to reproduce the niceties in Nushell I’m used to from my zsh config. Some of the important parts were setting up zoxide with a key binding for interactive mode, switching on vi key bindings, setting up my starship prompt.

    Home Manager is preconfigured for the above integrations which made things easier.

    One feature that is missing that I like to use is curly brace expansion to produce multiple arguments. For example,

    $ mv *.{jpg,jpeg}
    

    Unless there is a way to do something like this in Nushell that I haven’t seen yet?

    Something I enjoyed was automating a sequence of steps I’ve been running a lot lately due to a program that often partially crashes,

    def nkill [name_substring] {
      ps | where name =~ $name_substring | each { |p| kill $p.pid; $p }
    }
    

    I realized after writing this that I basically recreated killall -r. But it’s nice that it was so easy to make a custom command to do a very specific thing. And my version gives me a nice report of exactly what was killed.

    Thanks for making this post OP! When I’ve heard mentions of Nushell I’m the past I think I conflated it with Powershell, and wrote it off as a Windows thing. (Maybe because it’s introduced as being “like Powershell”.) But now that I see that it’s cross-platform I’m enjoying digging into it!

  • marco@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    10 months ago

    It’s cool, I just gave it a go, but I’m not sure it’s gonna happen that I’ll transition from

    ls -lrt (this does not work in NuShell)

    to

    ls | sort-by modified | reverse

      • marco@beehaw.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        Totally - for new users it’s great… similarly, I would have loved to start typing on Dvorak.

        My problem might be one of age, but there is no way I’m gonna retrain myself after 20+ years of typing that specific ls command… ;)

      • FUsername@feddit.de
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        While your argument is valid, most bash users I know are lazy bitches and tend to alias commands which require to type more than 5 letters. I guess NuShell lower the bar for NuUsers, but of I have to remember either single letters or puppy it through longer commands, I world opt for single letters.