My answer: `ls -a`
er, wrong. Then don't put all in the question!Twelve Days of Shell
51–60 of 89 posts
Re: Twelve Days of Shell
#52Hey 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?
Re: Twelve Days of Shell
#53Hey 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?
I prefer that way in theory but a capital "A" is not as quick/easy to type.
Re: Twelve Days of Shell
#54Re: Twelve Days of Shell
#55I 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
Re: Twelve Days of Shell
#56Hey 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.
> awk '/^laugh/ { print $0 }' night-before-christmas.txt
Re: Twelve Days of Shell
#57Re: Twelve Days of Shell
#58I'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.
Re: Twelve Days of Shell
#59The 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…
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
#60Great 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…