Slashdot poll: Most Useful UNIX Tool

Geekery,Linux — September 19, 2009 at 11:09 pm

In response to the current /. poll, Most Useful UNIX Tool: I have the following from my ~/.zhistory at work:

$ for cmd in sed grep cat find telnet init exit ; do echo -n $cmd= ; grep -c “$cmd ” ~/.zhistory; done sed=85 grep=875 cat=762 find=126 telnet=15 init=32 exit=33

Which is interesting to me. I can explain some of the counts:

  • I run ‘cat $file | (grep|sed|awk) | …’ too often out of a good/bad habit.
  • ‘exit’ is small because I’ve bound ”x’ to exit (which itself is a bad habit; I should have just started using ‘Control-D’.
  • ‘ssh’ > ‘telnet’
  • I don’t have root, so ‘init’ isn’t really used, and my regex isn’t careful enough to eliminate ‘disk_init’.
  • ‘sed’ is mega-useful, but is usually the second command in a pipeline. I want to start using ‘perl -pe’ more.

Auto-Dependency Generation in GNU Make

Coding,Geekery — September 19, 2009 at 9:13 am

I renovated some makefiles this week and found myself wanting to generate dependencies of a piece of code automatically from ‘gcc -M’. The existing Makefile had an explicit “make depends” step that would invoke ‘gcc -M’ for each of the source files. This is annoying because all generated Makefiles would have to be recreated if one file’s dependencies changed.

The GNU Make Manual has a section on automatically generating prerequisites, which only gets you part of the way.

I owe a good deal of gratitude to Tom Tromey and Paul D. Smith for creating and writing up instructions on how GNU Make can automatically generate dependencies for source files. They discuss even better ways of generating dependency files and build upon the GNU Make Manual method.

Olbermann rant on “You lie!” outburst

Personal — September 14, 2009 at 6:42 pm

This is a purely amazing rant on Joe Wilson’s “You lie!” outburst during Obama speech:

This is just true:

It is this week evident that the greatest threat to the nation… is not terrorism… nor the economy… nor H1/N1… nor even bad health care. It is rank, willful stupidity. When did we come to extol stupidity ahead of information, and rely on voo-doo, superstition, and prejudice ahead of education?

Two classic videos I’ve been thinking about (again)

In Brief — September 12, 2009 at 11:47 pm

Reggie and the Full Effect – Congratulations Smack and Katy

Brand New, Welcome to Bangkok

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | Eric Garrido