Cheat Sheet

all tags

Pages tagged with "cheat sheet":

awk Cheat Sheet

26 Mar 2019 , tagged: awk, unix, cheat sheet

I needed to crunch some data quickly and decided awk was the right tool to do so. But every time I use awk, I have to go read the manual, so I decided it’s time for a cheat sheet. Structure of an awk script # Comments begin with a pound sign BEGIN { # Instructions run before the main loop FS = ";" # Set a Field Separator } # Each line of input is applied against all the following # regular expressions and runs the instructions in the # block: /^$/ { print "An empty line" } END { # Instructions run after the main loop } Invoke awk with a script like so:

read more →