12 Days of Shell

(12days.cmdchallenge.com)

55 points | by zoidb 1 hour ago

12 comments

  • aargh_aargh
    50 minutes ago
    The good: Nice exercises for beginners. Tab-completion, accepts readline characters like ctrl-u.

    The bad: You don't see the (wrong) output if you don't get it right the first time, making it hard to work iteratively and having to guess what the question actually intended.

    E.g. 'Seven files that start with "Santa"' actually wants file names that start with Santa, after some questions that had you use "grep" to search file contents. Where I actually struggled with what's expected is Day 11.

    The ugly: Actually a very nice design.

  • janmatejka
    14 minutes ago
    'Seven files that start with Santa' is actually about filenames. That's pretty confusing especially since users are primed with file contents from the previous exercises already.

    And from pipers piping description I had no idea what was wanted of me.

  • beardyw
    19 minutes ago
    As a developer I've been through 10 different languages and about the same number of operating systems, and I barely managed to remember any of them, even at the time. And I assume soon using natural language as the main interface will become commonplace, which will finally let me off the hook.

    I will give this a go, but I doubt any of it will stick!

    • k_bx
      18 minutes ago
      Shell quotes is the last frontier LLM's seem to keep getting wrong. Esp when it's Github CI yaml which needs to ssh somewhere and run command running another command there. Needs AGI apparrently.
  • derrida
    36 minutes ago
    Hey this doesn’t work : first solution “ls -al” which I use all the time to list directories was rejected in the second question I used awk and was rejected it expected grep

    I think a beginner could be doing it right but then be told they are wrong as you aren’t evaluating actual commands

    Best would be to like actually run it* and then check solutions out with awk that it pattern matches

    * aka give me a shell ok worth a try lol xD

    Edit: also I was expecting something a bit more challenging (also that is correct) to like exercise the brain for those of us that use shell (this is hacker news) something that takes a few minutes and isn’t just commands used all the time

  • arionmiles
    59 minutes ago
    I've recently reached a point where I feel I've reached an upper limit with how much efficiency I can extract from my usual toolset/editors. So I've gone on a journey where I'm finally exploring tools that make living in the command line a productive and pleasant experience for me.

    I've long put off learning or even exploring tmux or learning more than a few handful of vim keybinds. So I started digging into configuring them and learning them well enough to be able to regularly use them for work and personal computers.

    It's been very pleasant, to say the least. There's still a few ways I need to go where I do everything from the command line and the keyboard, but I think it's worth training your muscles to be comfortable with doing things purely using the keyboard.

    I've switched to vim mode for a few tools that offer it. I started seriously using vimium on chrome and firefox (a friend had introduced me to it about 7 years ago but I never cared enough to learn it well).

    Another reason I finally made the jump was that I've been having RSI pain on my right hand due to using mouse too much and in un-ergonomic positions. While I've taken measures to improve ergonomic use of the mouse and keyboard, I'm just totally impressed with the capabilities of keyboard navigation and how much value you can extract out of your keyboard.

    My friends have been egging on me about the bell curve meme, but I think it's important for me to figure out the limits and then maybe I will finally go back to defaults and simpler tools. The only way to be on the right side of the bell curve is through the middle.

    • kace91
      52 minutes ago
      I went back and forth over the years with vim. Lazyvim plus the ebook (lazyvim for ambitious devs or something like that, it’s free online) is what allowed me to stick.

      I can’t be doing real work and suddenly realize I don’t know the way to do a certain basic action. Lazyvim makes it so that for everything you want to do, there’s an already configured way, and then you have all the time in the world to fiddle for a better alternative if you don’t like it.

    • kalaksi
      50 minutes ago
      For learning vim, I recommend searching for a "vim cheat sheet" that has an image of a keyboard layout with vim commands in it and printing that. Makes it easier to check and learn more, little by little.

      Another one is online tutorials that make you practice interactively. Haven't used those much but the little I did, it was helpful.

  • ParadisoShlee
    7 minutes ago
    I assumed this was some kind of hacking challenge.
  • benterix
    30 minutes ago
    It would be nice if the instructions spelled out what to do, then I could do it. Otherwise I have to guess what author meant. But all in, a nice small exercise, thanks!
  • Barathkanna
    1 hour ago
    Fun idea. It’s basically an Advent calendar for shell one-liners. Nice way to level up your CLI muscles without diving into full projects.
    • jll29
      21 minutes ago
      Neat.

      Perhaps it would be even nicer if the "advent" theme was more prominently present, e.g. using the Bible as the target data file to be used.

      Here's three examples tasks from me:

      (1) Write an sh script (using only POSIX standard commands) to create a Keywords in Context (KWIC) concordance of the new testament.

      (2) Write a bash script that uses grep with regular expressions to extracts all literal quotes of what Jesus said in the New Testament. [Incidentally, doing this task manually marked the beginnings of philology and later automating it marked the beginning of what was later called literary and linguistic computing, corpus linguistics, computational linguistics, and digital humanities.]

      (3) How many times is Jesus mentioned by each of the four accounts of his life (Matthew, Mark, Luke, and John)?

      (You may begin by extracting the New Testament from the end of the Bible with a grep command.)

      Dataset: https://openbible.com/textfiles/kjv.txt

  • pstoll
    51 minutes ago
    Neat idea à la regex golf.

    But doesn’t seem to do enough shell escaping or correctly. Also seems underspecified, ie “find 5 lines starting with ‘the” doesn’t require a pipe to head -5.

  • franticgecko3
    43 minutes ago
    Tab complete is completely broken on Firefox mobile (Android)
  • skinwill
    45 minutes ago
    Viewing the page with Safari 26.1 the questions stopped showing up after the second challenge. I was left with only Learn and View Solutions, which was not very fun since both showed a form of the answer.

    TL;DR: The page stopped loading properly.

  • bluecalm
    45 minutes ago
    It looks very nice. One problem I've encountered is that when you make a mistake then the name of the file you have to use disappears and it's impossible to get it back. What is this website created with btw? I like the style a lot.