Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. I feel like I'm getting better at shell fu.

I feel like I'm getting better at shell fu.

Scheduled Pinned Locked Moved Uncategorized
29 Posts 14 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • brouhaha@mastodon.socialB brouhaha@mastodon.social

    @acsawdey @gsuberland
    Awk is a bit awkward, but it's a piece of cake compared to Perl. But I, too, prefer Python.

    acsawdey@fosstodon.orgA This user is from outside of this forum
    acsawdey@fosstodon.orgA This user is from outside of this forum
    acsawdey@fosstodon.org
    wrote last edited by
    #16

    @brouhaha @gsuberland well, yes for anything other than 1-liners I too prefer python. But awk somehow is very amenable to doing tiny things like this:

    awk '{count[$0]++} END{for(x in count) { printf("%-10d %s\n",count[x],x) } } ' | sort -n

    paul_ipv6@infosec.exchangeP 1 Reply Last reply
    0
    • gsuberland@chaos.socialG gsuberland@chaos.social

      I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

      f3715h@rubber.socialF This user is from outside of this forum
      f3715h@rubber.socialF This user is from outside of this forum
      f3715h@rubber.social
      wrote last edited by
      #17

      @gsuberland consider toybox?

      gsuberland@chaos.socialG 1 Reply Last reply
      0
      • gsuberland@chaos.socialG gsuberland@chaos.social

        the main annoyance I have with shell stuff is how the command names defy discoverability.

        "I would like to flush my current shell history to the history file"

        "ok run fc -W"

        "huh. what does fc stand for?"

        "fix command"

        "... ok"

        elithebearded@fed.qaz.redE This user is from outside of this forum
        elithebearded@fed.qaz.redE This user is from outside of this forum
        elithebearded@fed.qaz.red
        wrote last edited by
        #18

        @gsuberland

        I use fc (through aliases) all the time and I have never heard a good explanation of the name.

        100% agreed discoverability is a huge problem in shell commands, built-in or not. I wrote a tool, "nums",then literally years later found out that "seq" does almost the same thing. Mine is only better in being smart about zero padding: "nums 01-10" pads, "nums 1-10" doesn't

        1 Reply Last reply
        0
        • R relay@relay.an.exchange shared this topic
        • gsuberland@chaos.socialG gsuberland@chaos.social

          I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

          tj@altelectron.org.ukT This user is from outside of this forum
          tj@altelectron.org.ukT This user is from outside of this forum
          tj@altelectron.org.uk
          wrote last edited by
          #19
          @gsuberland this annoys me so much. Even more when I get the builtin man page for something that is also a standalone tool. Which has a man page
          1 Reply Last reply
          0
          • f3715h@rubber.socialF f3715h@rubber.social

            @gsuberland consider toybox?

            gsuberland@chaos.socialG This user is from outside of this forum
            gsuberland@chaos.socialG This user is from outside of this forum
            gsuberland@chaos.social
            wrote last edited by
            #20

            @F3715H I read the readme and it isn't clear to me what toybox is. it also exclusively mentions Linux, which I don't use.

            1 Reply Last reply
            0
            • gsuberland@chaos.socialG gsuberland@chaos.social

              I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

              sludgephd@mastodon.socialS This user is from outside of this forum
              sludgephd@mastodon.socialS This user is from outside of this forum
              sludgephd@mastodon.social
              wrote last edited by
              #21

              @gsuberland in fish, this just works. Probably required a blood sacrifice of them though.

              1 Reply Last reply
              0
              • gsuberland@chaos.socialG gsuberland@chaos.social

                I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

                gsuberland@chaos.socialG This user is from outside of this forum
                gsuberland@chaos.socialG This user is from outside of this forum
                gsuberland@chaos.social
                wrote last edited by
                #22

                note: I am not asking for advice, I am simply stating a problem with the default state of things.

                1 Reply Last reply
                0
                • gsuberland@chaos.socialG gsuberland@chaos.social

                  I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

                  brhfl@digipres.clubB This user is from outside of this forum
                  brhfl@digipres.clubB This user is from outside of this forum
                  brhfl@digipres.club
                  wrote last edited by
                  #23

                  @gsuberland yeppppp, one of the messiest, most frustrating-for-no-good-reason issues with shell scripting imo

                  1 Reply Last reply
                  0
                  • R relay@relay.infosec.exchange shared this topic
                  • gsuberland@chaos.socialG gsuberland@chaos.social

                    I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.

                    dragonarchitect@rubber.socialD This user is from outside of this forum
                    dragonarchitect@rubber.socialD This user is from outside of this forum
                    dragonarchitect@rubber.social
                    wrote last edited by
                    #24

                    @gsuberland I think they supposedly do but the manpages for the builtins have always been infuriatingly unintuitive to find for me.

                    It's impossible for my shit ass adhd working memory to remember what all of the sections of the manpages hold what kind of information and yet the manpages are the standard go-to reference for everything shell like it's supposed to be innate knowledge to shell touchers. 😕

                    1 Reply Last reply
                    0
                    • acsawdey@fosstodon.orgA acsawdey@fosstodon.org

                      @brouhaha @gsuberland well, yes for anything other than 1-liners I too prefer python. But awk somehow is very amenable to doing tiny things like this:

                      awk '{count[$0]++} END{for(x in count) { printf("%-10d %s\n",count[x],x) } } ' | sort -n

                      paul_ipv6@infosec.exchangeP This user is from outside of this forum
                      paul_ipv6@infosec.exchangeP This user is from outside of this forum
                      paul_ipv6@infosec.exchange
                      wrote last edited by
                      #25

                      @acsawdey @brouhaha @gsuberland

                      at an early ISP, our entire billing system for 3000 UUCP/TCP customers was a huge awk program that produced a single postscript file that we printed to snail mail out bills.

                      it was so hairy that the UCB UNIX folks used it as a final regression test for new releases of awk.

                      acsawdey@fosstodon.orgA brouhaha@mastodon.socialB 2 Replies Last reply
                      0
                      • paul_ipv6@infosec.exchangeP paul_ipv6@infosec.exchange

                        @acsawdey @brouhaha @gsuberland

                        at an early ISP, our entire billing system for 3000 UUCP/TCP customers was a huge awk program that produced a single postscript file that we printed to snail mail out bills.

                        it was so hairy that the UCB UNIX folks used it as a final regression test for new releases of awk.

                        acsawdey@fosstodon.orgA This user is from outside of this forum
                        acsawdey@fosstodon.orgA This user is from outside of this forum
                        acsawdey@fosstodon.org
                        wrote last edited by
                        #26

                        @paul_ipv6 @brouhaha @gsuberland I mean, that's probably better than writing it in BASIC (ask me how I know 😂)

                        1 Reply Last reply
                        0
                        • gsuberland@chaos.socialG gsuberland@chaos.social

                          the main annoyance I have with shell stuff is how the command names defy discoverability.

                          "I would like to flush my current shell history to the history file"

                          "ok run fc -W"

                          "huh. what does fc stand for?"

                          "fix command"

                          "... ok"

                          mmu_man@m.g3l.orgM This user is from outside of this forum
                          mmu_man@m.g3l.orgM This user is from outside of this forum
                          mmu_man@m.g3l.org
                          wrote last edited by
                          #27

                          @gsuberland one thing PowerShell kinda tried to fix… not sure it worked out though (WGet!?)

                          maybe nushell… but they seem to be OK with LLMs 😒

                          1 Reply Last reply
                          0
                          • paul_ipv6@infosec.exchangeP paul_ipv6@infosec.exchange

                            @acsawdey @brouhaha @gsuberland

                            at an early ISP, our entire billing system for 3000 UUCP/TCP customers was a huge awk program that produced a single postscript file that we printed to snail mail out bills.

                            it was so hairy that the UCB UNIX folks used it as a final regression test for new releases of awk.

                            brouhaha@mastodon.socialB This user is from outside of this forum
                            brouhaha@mastodon.socialB This user is from outside of this forum
                            brouhaha@mastodon.social
                            wrote last edited by
                            #28

                            @paul_ipv6 @acsawdey @gsuberland
                            In the 1990s, I wrote a two-pass cross-assembler for the HP-2100 series minicomputers in awk. I eventually ran up against things that were hard to do in awk, so I ran it through an awk-to-perl translator, then struggled with that.

                            At the time, I wasn't aware of Henry Spencer's aaa, the Amazing Awk Assembler.

                            paul_ipv6@infosec.exchangeP 1 Reply Last reply
                            0
                            • brouhaha@mastodon.socialB brouhaha@mastodon.social

                              @paul_ipv6 @acsawdey @gsuberland
                              In the 1990s, I wrote a two-pass cross-assembler for the HP-2100 series minicomputers in awk. I eventually ran up against things that were hard to do in awk, so I ran it through an awk-to-perl translator, then struggled with that.

                              At the time, I wasn't aware of Henry Spencer's aaa, the Amazing Awk Assembler.

                              paul_ipv6@infosec.exchangeP This user is from outside of this forum
                              paul_ipv6@infosec.exchangeP This user is from outside of this forum
                              paul_ipv6@infosec.exchange
                              wrote last edited by
                              #29

                              @brouhaha @acsawdey @gsuberland

                              our founder challenged tom christianson to convert the awk script to perl but tom declined the bet...

                              1 Reply Last reply
                              1
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups