From 070107ab956dd39a33a94b7e92fc4f2e64bfa47a Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sat, 2 Oct 2010 15:23:57 -0700 Subject: [PATCH] Added a function to get your public IP address --- README.md | 3 +-- bash_it.sh | 14 +++++++------- functions/base.funtions.bash | 9 +++++---- lib/history.bash | 6 +++++- plugins/base.plugin.bash | 10 +--------- 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 0e622f1..caafe06 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,7 @@ cp template/bash_profile.template.bash ~/.bash_profile I'm working on adding various custom help screens to bash it. Currently, bash it has the following commands to show help screens:

-bash-it
-plugin-help
+bash-it (will show all the help commands)
 rails-help
 git-help
 
diff --git a/bash_it.sh b/bash_it.sh index c74668c..3f52aba 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -6,6 +6,13 @@ alias reload='source ~/.bash_profile' # Load all files +# Themes +THEMES="${BASH}/themes/*.bash" +for config_file in $THEMES +do + source $config_file +done + # Library LIB="${BASH}/lib/*.bash" for config_file in $LIB @@ -28,13 +35,6 @@ do source $config_file done -# Themes -THEMES="${BASH}/themes/*.bash" -for config_file in $THEMES -do - source $config_file -done - # Functions FUNCTIONS="${BASH}/functions/*.bash" for config_file in $FUNCTIONS diff --git a/functions/base.funtions.bash b/functions/base.funtions.bash index bbb6f2f..f0544c6 100644 --- a/functions/base.funtions.bash +++ b/functions/base.funtions.bash @@ -1,13 +1,14 @@ #!/bin/bash -function rh { - history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head -} - function ips { ifconfig | grep "inet " | awk '{ print $2 }' } +function myip { + res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+') + echo "Your public IP is: ${LIGHT_GREEN} $res ${NORMAL}" +} + # View man documentation in Preview pman () { diff --git a/lib/history.bash b/lib/history.bash index 3d489e9..c7dcaa6 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -14,4 +14,8 @@ export HISTCONTROL=erasedups export HISTSIZE=5000 -export AUTOFEATURE=true autotest \ No newline at end of file +export AUTOFEATURE=true autotest + +function rh { + history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head +} \ No newline at end of file diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 9b0da33..c256247 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -8,12 +8,4 @@ alias xcode="open -a '/Developer/Applications/Xcode.app'" alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'" alias safari="open -a safari" alias firefox="open -a firefox" -alias dashcode="open -a dashcode" - -function plugin-help() { - echo "Plugin Help Screen" - echo - rails-help - echo - git-help -} \ No newline at end of file +alias dashcode="open -a dashcode" \ No newline at end of file -- 2.17.1