Created
March 10, 2012 01:11
-
-
Save akatz/2009542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function instance_role { | |
grep instance_role /etc/chef/dna.json |awk -F\" '{print $4}' | |
} | |
function instance_id { | |
grep this /etc/chef/dna.json |awk -F\" '{print $4}' | |
} | |
function public_hostname { | |
ohai |grep public_hostname | awk -F\" '{print $4}' | |
} | |
function instance_name { | |
grep `public_hostname` /etc/chef/dna.json -B 1 |grep "\"name\"" |awk -F\" '{print $4}' | |
} | |
PS1="\[\033[01;31m\]`instance_role` `instance_id` `instance_name`\[\033[01;34m\] \W \$\[\033[00m\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
turns
ip-10-88-234-138 ~ # source .bashrc
into:
util i-9377c7f7 ~ $