grep and awk. For instance, grepping strings with hyphens isn't as easy as "grep -dev". What you need to do is "grep [\-\]dev". I was also needing to get every other line of output from one command, and I found a way to do that in awk: command | awk 'NR > 2 && (NR % 2 == 0 ){ print} /^$/{NR=0}' | xargs other_commandThis stuff is quite fun. Hopefully, pretty soon, I will have a bunch of scripts that get what hardware you have (as seen by linux) and get the Windows-driver counterpart among other things.

No comments:
Post a Comment