Method I used to solve this problem


#1

After seeing the the first hint revealed (it did it automatically), I figured I would grep for the ‘-’ in the file to eliminate the lines that did not match the intended output. After that, I got a bit stuck on how to eliminate lines that may contain letters. Checked the man page for grep and found that I can use -v to not print lines with an expression. Once I found that, it was about order in the command.

So my solution is way different than the one that is shown on this site. I too did not see a -P option to grep.

cat input | grep -Ev ‘[a-zA-Z]’ | grep ‘-’