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.
Just the lines from the files are wanted, not the files names. It took me a little while to cotton on to that.
Semi-spoiler follows.
So you need to use the appropriate flag with grep to suppress the file names.
"lines that contain 'laugh'". lines of what? Doesn't tell you without looking at the answer.
genius.
I gave up after the following exercise:
On the eighth day of Shell my true love gave to me Eight elves in Santa's Workhop/ ... Hint: Try finding files named after Elves and moving them to the Workshop/ directory.
It turns out, all they want is the files in the ./Elves directory to the ./Workshop directory. But I didn't figure that out.
1. It's difficult to know that it is following from the previous problem, and then on some problems it changes the workspace.
2. It's not always easy to know what it wants.
3. The question about finding a line starting with "The" I successfully cheated:
cat night-before-christmas.txt | grep "The "
4. Likewise the ending "!": cat night-before-christmas.txt | grep "!"
5. On the eighth day I get a "runner error" with the command: mv *lve* Workshop
I'm globbing for the filename match, I'm not sure if it's "elve" or "Elve" and then trying to move to the target directory.Otherwise it's quite fun - the instant feedback is great.
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.
> I've been having RSI pain on my right hand due to using mouse too much and in un-ergonomic positions
If you can, try using a left-hand vertical mouse. I use an Evoluent but there are a million brands. Get a cheapo and try it out. I figure it took me about a week to adjust and my wrists have been happier ever since.
Another one is online tutorials that make you practice interactively. Haven't used those much but the little I did, it was helpful.
I learnt the basics of vim navigation through it. I'm yet to finish it since I dropped it after the first chapter to start using it as a daily driver and picking things as I need. I will probably come back and go through it again at some point and by then it will be another mind-blown situation
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.
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
I prefer that way in theory but a capital "A" is not as quick/easy to type.
> awk '/^laugh/ { print $0 }' night-before-christmas.txt
grep laugh *
There's only one file in the directory. So that's a correct answer but the game wants me to run grep laugh night-before-christmas.txt
It's like those weird interviewers who have a specific answer in mind and they'll accept nothing other than the answer they have in mind. Output does not match expected lines - try again
So you can't move on to the next level. Output does not match expected lines - try again
Does it give you the clue for the next level? Can you or someone else share a screenshot or something so I can compare to find out what I'm missing?There is some mess if you already finished the thing, and then use url to particular level on a clean session. For me it looked like I am on level 2, but site expected answers to 1.
When I start from scratch with proper link (main page) simple:
grep laugh *
works
And from pipers piping description I had no idea what was wanted of me.
I will give this a go, but I doubt any of it will stick!
* https://en.wikipedia.org/wiki/Twelve_Days_of_Christmas
The days before the 25th are part of the season of Advent:
But that's kind of understandable when Christmas begins in September if you believe the retailers.
Ah, a fellow Commonwealther (I'm Canadian):
Commercialism is likely the culprit for the current state of affairs. By putting the "Christmas season" and the commercialized variety of festivity before Christmas and making Christmas day the big finale, you create a situation during which you can get people to buy, buy, buy. And then it's over.
Compare that with the real deal and as it was traditionally celebrated. Advent is a period of contemplation, waiting, quiet, abstinence from meat -maybe even fasting - in anticipation for the birth of Christ. Then, on Christmas Eve and especially Christmas day, the festivities kick off, and they last until January 6th (the 12 days of Christmas) or Candlemas (40 days of Christmas). And that's when people used to pack up their trees and decorations (either Jan 6th or Feb 2nd).
People today suck at festivity. We're boring.
b64(r13(MaE3o3OmYz5yqPNtqUu0VPOxnJpX)) My answer: `ls -a`
er, wrong. Then don't put all in the question!Like, do a complex background worker for a web server that listens to a socket, does complicated stuff, exports functions (if in Bash), etc.
You don't have to use it afterwards. The value is in the journey. It's fun :)
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.)
Specifically, while it is true that certain kinds of words can become decoupled from their original meanings (which is generally normal), in this case, the usage is not so decoupled, especially given that this usage occurs during the religious season of Advent and with the intentional allusion to the religious season of Advent. (Otherwise, what is "Advent of X" without its religious origin and which takes place at the exact same time during the year?)
You can make a much stronger argument that the non-religious usage is a kind of cultural appropriation. That would make your concern entirely backwards. Your wish is to keep it "neutral" to please those who don't practice Advent, as you show a simultaneous lack of concern for the tradition it appropriates from. This involves a tacit claim of possessing the authority to do so as well, but if anything, given the source, if anything, the authority belongs not to the appropriators, but to the Church.
One wonders how a "Ramadan of Code" or "Teshuvah of Shell" would be received.
"Neutrality" is, of course, a bunk concept, and the idea that we ought to be guided by what is "nice" rather than what is "good" is a grave misunderstanding of how decisions ought to be made.
I found a-Shell's documentation[1] quite interesting, it describes their use of web assembly and offers some practical tips for compiling stuff so it can work in a sandboxed environment.
[1]: https://bianshen00009.gitbook.io/a-guide-to-a-shell/lets-do-...
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.
Especially since the previous two questions used head/tail. IMO, the wording would be better as "find all the lines" since that's what the command does.
After the 3rd time I had to peek at "learn" to understand what was even asked, I gave up. This is more annoying than fun.
other than that - nice exercise for newbie shell dabblers :-)
TL;DR: The page stopped loading properly.
Who would've guessed...