The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.

At #9 "replace a part of a string" there is a pitfall for the unaware: if we use variables instead of literals in place of the search string and their values contain the special character * then, we have results that depend of the setting of nullglob! See my answer there: http://stackoverflow.com/questions/525592/find-and-replace-inside-a-text-file-from-a-bash-command/14753895#14753895