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...