Type less, smile more

How many times a week do you type /etc/init.d/blah start and then you realize you’re on HP-UX and it’s /sbin/init.d/blah Forget it. # Turn on extended globbing and programmable completion shopt -s extglob progcomp export MYOS=$(uname -s) if [[ “${MYOS}” = “Linux” || “${MYOS}” = “SunOS” ]] ; then INITDIR=’/etc/init.d’; else INITDIR=’/sbin/init.d’; fi export INITDIR; …

Be yourself, even when you’re root

Ever run a command only to realize you’re not root but need to be? Of course you have. What if that command was long and painful to create? There’s no reason, Dude, to not have access to your bash history even after becoming root vi ‘su’. function su () { local SUUSER=root local ORIGU=$USER local …

Bash & Screen

You may be familiar with my tutorial on getting your ssh-agent to work inside screen. If not, have a look. There’s always room for improvements! Here’s an excerpt from my current .bash_profile: function Attach(){ grabssh if [[ -z “${1}” ]] ; then local n=`screen -wipe | egrep -i ‘attached|detached’ | wc -l` if [[ “${n}” …