Live data from Hacker News

Twelve Days of Shell

12days.cmdchallenge.com

51–60 of 89 posts

Re: Twelve Days of Shell

#52
post #35
post #11

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 wort…

"ls" shows only visible files whereas "ls -a" also displays those starting with a dot. Given the question doesn't that make your answer the correct one?

It accepts ls -a as and answer and ls -l but not ls -al

Re: Twelve Days of Shell

#53
post #35
post #11

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 wort…

"ls" shows only visible files whereas "ls -a" also displays those starting with a dot. Given the question doesn't that make your answer the correct one?

`la -A` will also show hidden files but excludes the "." and ".."

I prefer that way in theory but a capital "A" is not as quick/easy to type.

Re: Twelve Days of Shell

#55

I would love something like this that puts me in my own shell. Like a light CTF that is really just shell commands rather than breaking into a VM

I went searching and realized overthewire has a bash specific course called "Bandit". Still a VM you SSH to

Re: Twelve Days of Shell

#56
post #49
post #11

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 wort…

It does seem to actually run the submitted commands, and awk is there.

Second question

> awk '/^laugh/ { print $0 }' night-before-christmas.txt

Re: Twelve Days of Shell

#57
post #56
post #49

Earlier quoted context omitted.

It does seem to actually run the submitted commands, and awk is there.

Second question > awk '/^laugh/ { print $0 }' night-before-christmas.txt

Get rid of the caret and it works; it wants lines with laugh, not lines that start with laugh,

Re: Twelve Days of Shell

#58

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 configur…

Forget cheatsheets, tweets, videos, books, etc. Vim comes with a very well made built-in tutorial that will gently pull you toward maximum efficiency.

been using vim for years, just did the tutorial and learned several things I did not know

Re: Twelve Days of Shell

#59

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…

> Where I actually struggled with what's expected is Day 11.

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.

Re: Twelve Days of Shell

#60
post #31

Great idea, but a few feedback points: 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 ei…

iirc Elves is a directory with them inside.
Post reply on HN