News for hackers. Stuff that matters.
Re:Show HN: Command Line Challenge by MrQuincle on Thursday January 26, 2017 @06:28PM (#13496378)
That was a tough one. In the end something like this:

< war_and_peace.txt tr -s '!' | sed 's/!\([a-z]\)/\1/g' | sed 's/!\( [a-z]\)/\1/g' | sed 's/!\.!/./g' | sed 's/ !/ /g'

However, I don't think I learnt much from that. :-)

Re:Show HN: Command Line Challenge by arde on Thursday January 26, 2017 @10:08PM (#13497395)
Mine was a bit more procedural, if that's what you were looking for:

  awk '{l++;gsub("!","");t[1]=4;t[4]=2;t[9]=3;o=$1;for(i=2;i<=NF;i++){o=o " " $i (i==t[l]?"!":"")};print o}' war_and_peace.txt