Or any other alternate shells that aren’t bash?

  • ziviz@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    17 hours ago

    I use powershell for some scripting. I’ve been using .net/powershell forever and I know it better than python. If bash can’t handle it in a few lines, and I don’t have to use python, I’ll go powershell.

  • golden_zealot@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    15 hours ago

    I’ve used powershell in previous jobs and if you learn it really well I cannot deny it is super powerful.

    For a college project, a friend of mine somehow made a hexadecimal file dumper with it, with formatting and everything (think like what you would see in wireshark) in one, reasonably long, line of powershell.

    However I’m just not a big fan of it personally for syntactical reasons (even with the syntax being super logical) and much prefer bash, or other unix-like native shells. I’ve been thinking about taking zsh for a spin recently to see what it’s like.

  • the_weez@midwest.social
    link
    fedilink
    arrow-up
    6
    ·
    1 day ago

    Only when I’m doing MS shit for work. Otherwise I find it kind of a pain. I get that some of it’s ideas are nice, but functionally it doesn’t actually do anything for me on unixy systems that bash doesn’t so I don’t. I’m not going to install it on all my servers so using it for scripting doesn’t make sense and I do more Linux admin than MS.

    • LeFantome@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      14 hours ago

      If you are using FreeBSD, you are probably using the Almquist Shell.

      https://en.m.wikipedia.org/wiki/Almquist_shell

      BSD has not used Bourne since the 90’s. Bash is of course the “Bourne Again Shell”.

      For Linux fans, “dash” is the (Debian Almquist Shell). It is the Linux version of the BSD shell. Dash is the default /usr/bin/sh in Debian and Ubuntu I think. So, pretty close to the same shell as FreeBSD.

  • lordnikon@lemmy.world
    link
    fedilink
    English
    arrow-up
    77
    arrow-down
    3
    ·
    2 days ago

    The idea of someone using powershell when you are on Linux is a form of self harm and you need to reach out as its clearly a cry for help.

  • Mactan@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    1 day ago

    only for extraordinarily cursed situations where games need it in wine/proton

  • beeng@discuss.tchncs.de
    link
    fedilink
    arrow-up
    8
    ·
    1 day ago

    At work we use it sometimes on Linux because we maintain a script that needs to work on multiple platforms, ps1 did that in this usecase better.

    Came down to ps1 on Linux was better and more predictable than bash on windows.

    Sadly.

    • Papamousse@beehaw.org
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Same, only time we used it is when we needed a script that was running in Windows and Linux, easier to maintain one script that 2 in 2 languages

  • hobbsc@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    only when dealing with azure for work. otherwise bash/python work just fine and have for me for the last 30 odd years.

  • Heavybell@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    I use it for some things. It’s good for file batch processing, for example. I could probably do those things in python but I use C# and powershell at work so I know .net better.

    • Johannes Jacobs@lemmy.jhjacobs.nl
      link
      fedilink
      arrow-up
      24
      arrow-down
      3
      ·
      2 days ago

      Because, as someone who dislikes MS as much as possible, Powershell is one of the few things they done right :) And when you manage mostly Windows servers and a few Linux servers, why not choose a solution that works on both platforms? And yes, perl, python, ruby, they all work on Windows too, but its just not comparable to powershell on Windows.

      So i can understand why someone asks this question :)

      Personally, i keep them both seperated, powershell on Windows, bash on Linux. But i can understand why someone might choose to go “powershell all the way” :)

      • Badabinski@kbin.earth
        link
        fedilink
        arrow-up
        6
        ·
        1 day ago

        Powershell is a better language but is absolutely dogshit for interactive use IME. It’s SO wordy and the excessive use of camelCase is annoying and I yearn for simple GNU coreutils every time I touch it. Like, give me tail -f please, why does cat also have a -Wait option or whatever the fuck

      • Trey A@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Understandable sentiments. I’m a MS Edge user, for instance, and despite slowly switching almost all my other services, MS Edge just gets it all right. Brave’s featureset is basically a lesser version, and Firefox is getting better, but Microsoft (of all companies) genuinely made a great browser.

    • Euphoma@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      15
      arrow-down
      3
      ·
      2 days ago

      Why not? It seems like a well supported shell on windows that isn’t terrible.

      • Mordikan@kbin.earth
        link
        fedilink
        arrow-up
        28
        arrow-down
        4
        ·
        2 days ago

        It seems like a well supported shell on windows

        But you aren’t using Windows. You’re also now adding a .NET Core requirement for any Linux box wanting to use it. That means limited functionality as its not the full blown .NET framework. So, compared to something like bash, you now have added requirements with less functionality.

        To answer your original question though, a lot of people prefer zsh as its got a crazy amount of customization you can do. People also like fish due to it being very friendly and interactive.

        • Übercomplicated@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          13 hours ago

          For a long time I used a super customized zsh setup. It was, unfortunately, crazy slow and regularly broke on updates. It had precisely all the features and behavior I wanted though. Like you say, zsh is very customizable.

          Then I switched to tiling window managers and with that to the alacritty terminal. This made me value start up times and performance, as I was constantly opening and closing terminals. So I spent a ridiculous amount of time optimizing my zsh config to be as fast as possible. This is also what I used for a long time before correcting my ways.

          When that device, my work laptop, failed, I had to set up my desktop for work. This involved setting up zsh, which I quickly realized was a lot of work. So, on a whim, I installed fish.

          Oh my god. Not only did fish have nearly all the features I wanted out of the box, but it was easy to add plugins (customizations) in a performant way. Fish even had default behavior I didn’t know I needed. And most importantly: it was crazy fast!

          Since then I have never left fish. It is so much better than anything I had imagined. At this point I use way more default features as well, so I pretty much only add the tide prompt and zoxide. I also have a functions and abbreviations folder which is essentially my zsh alias collection.

          The crazy part is really how much faster it is though. I really, really love it. And now they’re rewriting it in Rust as well!

        • LeFantome@programming.dev
          link
          fedilink
          arrow-up
          14
          arrow-down
          2
          ·
          2 days ago

          limited functionality as it’s not the full blown .NET

          This is misleading to the point of being completely wrong

          On Linux, you do not have access to Windows UI frameworks like WinForms, the Windows registry, and to System.Drawimg (because it is just a thin wrapper over Win32). Essentially the entire .NET standard library is available on Linux.

          I would argue that .NET is actually better on Linux for some things (like web dev).

          That said, I can see no reason to use PowerShell on Linux unless you are a .NET dev.

          There are PowerShell cmdlets that do not work on Linux. Again, mostly stuff that talks to explicitly Windows services and sub-systems. But that has nothing to do with .NET at all. Also, path separators and case sensitivity is different on Linux. So, cross-platform scripting is a pain.

        • nfms@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          I’ve once created a profile with about 1500 lines of code for powershell, managing AD at work. It was great to learn, it’s great for scripting and it’s very intuitive (for me at least), I also liked working with objects.
          I wouldn’t use it on Linux though, I’m not sure how well integrated it is.
          I’m using fish at the moment, desktop and server, and I like it primarily for the functions and the autocomplete

    • jollyrogue@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Because I have to admin Windows boxes and M365. There are PS modules for lots of different MS things.

    • lightnsfw@reddthat.com
      link
      fedilink
      arrow-up
      4
      ·
      2 days ago

      I didn’t know you could use it on Linux. I’d consider it because I’ve used it at work for years and my experience with bash is far more limited. Powershell is pretty damn intuitive. I’ve gotten a lot further with it than I have any other scripting language.

    • signofzeta@lemmygrad.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      Because I never learned Bash scripting, for whatever reason, and WSL wasn’t yet available to load on my work PC at the time.

    • DasFaultier@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      2 days ago

      If you run VMware, you can use PowerCLI to interact with your vSphere servers, and PowerCLI requires PowerShell and uses similar syntax. I haven’t tried it on Linux yet, but I would assume that that might be a valid use case.

        • DasFaultier@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          21 hours ago

          It’s been a while for me and i can’t try things out atm, but i think vSphere SSH access is only for managing the appliance itself, not objects like VMs in a vSphere cluster. For that, you would have to use the Python SDK or PowerCLI.

            • Auth@lemmy.world
              link
              fedilink
              English
              arrow-up
              3
              arrow-down
              1
              ·
              2 days ago

              zero intergration? Thats just wrong. I’d argue you can do anything with PS on linux that you can with bash.

              • just_another_person@lemmy.world
                link
                fedilink
                arrow-up
                2
                arrow-down
                3
                ·
                2 days ago

                Perfect example:

                Bash: sudo dnf install python

                OR

                PS: `Invoke-Expression ‘sudo dnf install package-name’

                Stupid to even try and make the argument that PS is a viable solution to anything at all with its ignorant declarations of obvious usage.

                • bravemonkey@lemmy.ca
                  link
                  fedilink
                  arrow-up
                  4
                  arrow-down
                  2
                  ·
                  edit-2
                  2 days ago

                  With PowerShell on Linux you’d never run dnf starting with Invoke-Expression. It’s completely unnecessary.

                  This feels like you either legitimately don’t know how it works so are assuming, or are making it more complicated on purpose to make bash look ‘better’.

                  I’m not saying PowerShell should be used on Linux over bash, but your example is not a good one.

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          2
          ·
          2 days ago

          The practical purpose of asking is to get a feel for how many people use it.

          Less tongue in cheek though, it sounds like you have the same questions as OP. If you’re curious what might be the practical purpose, why not ask people who use it why they do instead of berating OP for asking if anyone uses it?

          • just_another_person@lemmy.world
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            2 days ago

            Well by that logic, it’s a way for Windows users to not learn the native tooling available, but not skip any steps. It doesn’t make any sense.

            Learning Powershell in a Linux environment is going to just absolutely be a crutch and fuck up your ability to interact with other Linux systems that don’t share your particular environment.

            • JackbyDev@programming.dev
              link
              fedilink
              English
              arrow-up
              2
              arrow-down
              1
              ·
              1 day ago

              As someone who used bash on Windows through MSYS, I don’t see the issue. It was different, not inferior, to cmd and PowerShell. If someone wants to use PowerShell on Linux why be such a condescending jerk about it? Sometimes people just wanna try things for the fun of trying new things.

  • Sina@beehaw.org
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    1 day ago

    Basically no one is using powershell on Linux. zsh is popular and i’m using fish.