• lazynooblet@lazysoci.al
    link
    fedilink
    English
    arrow-up
    26
    ·
    12 hours ago

    Does it depend on some shell or shell extension? My bare bones Debian installs don’t do this. Powershell does but I’d like it on Linux too.

    • smeg@feddit.uk
      link
      fedilink
      English
      arrow-up
      13
      ·
      11 hours ago

      You can install powershell on Linux if you’re feeling masochistic

            • AMoistGrandpa@lemmy.ca
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              7 hours ago

              If you feel like learning a third shell, I find that Nushell is even easier to use than PowerShell.

              open stuff.json | each { get fieldName } | where { str starts-with "asdf" } | each { $in | str upcase }

              This gets all the objects in the given json file, then grabs the value of the field named “fieldName”, then filters all those values to find the ones that start with and, converts those to uppercase, and prints them to the screen as a nicely formatted list

              • AeonFelis@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                4 hours ago

                You don’t need the $in | in that last command. each { str upcase } will already pipe each item to the str upcase command.

            • ulterno@programming.dev
              link
              fedilink
              English
              arrow-up
              0
              ·
              5 hours ago

              Yeah, it does tend to be hard to determine when to use () {} [] etc.
              Even after I RTFM and used those in scripts multiple times, I tend to forget it by the time I need to implement something next.

    • The Quuuuuill@slrpnk.net
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      yeah you’ll have to install some helper scripts or switch to either fish or zsh. bash is nicer than bourne shell, but it is VERY basic in features by modern standards

      • rtxn@lemmy.worldM
        link
        fedilink
        arrow-up
        5
        ·
        10 hours ago

        ZSH still needs the completion data files to be installed. It won’t just magically know the completions.

        • floquant@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          3
          ·
          9 hours ago

          Ah you’re right, my bad. I automatically install oh-my-zsh so I forget how much functionality is bundled into it. Edited

    • Dave@lemmy.nz
      link
      fedilink
      arrow-up
      2
      ·
      12 hours ago

      I don’t know the answer but does tab to autocomplete work in other contexts? E.g. you type ‘cd ca’ and it fills it to ‘cd catpics’?

      I’m not at a PC right now but from memory you’d have to be in bash or similar, it won’t work in sh.