Posts

Showing posts with the label linux

Linus Torvalds Management Lessons

See the recent article on management lessons from Linus Torvalds.  Some important call-outs: On external quality: Torvalds concludes, “Way too many projects seem to think that the code is more important than the user, and they break things left and right, and they don't apologize for it, because they feel that they are ‘fixing’ the code and doing the right thing.” On tooling: “I don't think tools are all that fundamentally  important.” “Now, what is important is that there's  a good workflow for the project , and tools can certainly help with that,” said Torvalds. “But most projects don't necessarily really need tools. There's a lot of projects that simply don't have enough changes to really require any tools at all for their work flow; [...]"

Bash coolness

There is a clever feature in bash, in that you can do a lot of manipulations while accessing a variable. Note that I always use "clever" in a pejorative sense, but while this is clever (argh) it is also helpful to me. I find that I, like all users, will tolerate a little cleverness if it gets my work done. In this case, it's the substitution features that get my attention. For variables: ${VAR:-zzz} returns $VAR, or "zzz" if $VAR is empty ${VAR//x/y} returns $VAR after replacing all "x" with "y" ${VAR:=zzz} returns $VAR or "zzz" if VAR is unset, and assigns VAR (ick) And of course the coolest version is the $() operator (AKA: command substitution), which used to be done with ugly backticks. This runs a command and returns the output of the command into a variable: $(echo $fname| cut -d. -f1) $(echo $(basename $fname) | cut -d -f1) Which leads to this kind of "clever" coding: dest=${DESTDIR:-/tmp}/$(echo $(basename ${sourc...