Bash goodies

Found some really neat BASH stuff here: http://www.shell-fu.org/

Namely (for your .bashrc):

#Enable checkwinsize so that bash will check the terminal size:
shopt -s checkwinsize

#Create an in-line calculator:
function calc { echo “${1}”|bc -l; }

#Show a calendar with today’s date bolded:
function today { cal | sed “s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed ‘s/\(.\)/\x1b\[0;33m\x1b\[1m\1\x1b\[0m/g’) /”; }

The last (calendar) one I had to hack to get to work properly!

For other colorization, go here:

http://wiki.archlinux.org/index.php/Color_Bash_Prompt

JP

Advertisements

Feel Free to Comment (Name/Email/Website optional):

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: