You shouldn't do that, but not because it's not neat enough.
/tmp is world-writable, so you might be writing to somebody else's file, or over a symlink that was set up by someone else.
Use mktemp¹ for creating temporary files.
Somewhat tangential, but the author calls out using `grep` in conjunction with `awk`. Anytime I find myself doing this, it usually turns out that I can just throw the pattern into AWK itself.
grep 'foo' file.txt | awk '{ print $1 }'
Becomes:
awk '/foo/ { print $1 }' file.txt
There may be times when `grep` is preferable, but this is ubiquitous enough that it's mentioned in the "Useless Use of Cat" [1] awards.
One of my favorite moreutils tools is combine[1]. It allows you to compare the contents of text files with boolean operations. For example, want to know what lines are in file1 but not file2? Use:
¹ http://man7.org/linux/man-pages/man1/mktemp.1.html
reply