Created
December 30, 2010 10:29
Revisions
-
schallis revised this gist
Aug 14, 2011 . 1 changed file with 15 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,16 +3,28 @@ # $ tel steve # 3900 - Steve Challis # Terminal colour codes export CYAN="\033[0;36m" export GREEN="\033[0;32m" PHONE_LIST='/usr/share/phone-extensions.txt' tel() { local NUMBER=$CYAN local TEXT=$GREEN if [ ! $1 ] then # Show all if no argument specified cat $PHONE_LIST | less else # Use agrep if available type -p agrep &>/dev/null && grepper="agrep -1" || grepper="grep" echo -en "$TEXT" echo -e "$grepper -i $* $PHONE_LIST | egrep '^[^\*].*' | sed 's/\([0-9]\{2,11\}x\{0,4\}\)/$NUMBER\1$TEXT/g'" | bash - echo -en "$NO_COLOUR" fi } -
schallis revised this gist
Aug 14, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,6 @@ tel() { else # Use agrep if available type -p agrep &>/dev/null && grepper="agrep -1" || grepper="grep" echo "$grepper -i $* $PHONE_LIST | egrep '^[^\*].*'" | bash -; fi } -
schallis revised this gist
Aug 14, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,6 @@ tel() { else # Use agrep if available type -p agrep &>/dev/null && grepper="agrep -1" || grepper="grep" echo "$grepper -i $* $PHONE_LIST | egrep "^[^\*].*"" | bash -; fi } -
schallis revised this gist
Aug 14, 2011 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,16 @@ # $ tel steve # 3900 - Steve Challis PHONE_LIST='/usr/share/phone-extensions.txt' tel() { if [ ! $1 ] then # Show all if no argument specified cat $PHONE_LIST | less else # Use agrep if available type -p agrep &>/dev/null && grepper="agrep -1" || grepper="grep" echo "$grepper -i $* $PHONE_LIST" | bash -; fi } -
schallis revised this gist
Aug 14, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Quick Bash function to lookup telephone extensions. Better if agrep is installed. # Usage: # $ tel steve # 3900 - Steve Challis -
schallis renamed this gist
Aug 14, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
schallis revised this gist
Aug 14, 2011 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ # Quick Bash function lookup for telephone extensions # Usage: # $ tel steve # 3900 - Steve Challis tel() { list=~/usr/share/phone-extensions.txt -
schallis created this gist
Dec 30, 2010 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # Quick Bash function lookup for telephone extensions tel() { list=~/usr/share/phone-extensions.txt if [ ! $1 ] then # Show all if no argument specified cat $list | less else # Use agrep if available type -p agrep &>/dev/null && grepper="agrep -1" || grepper="grep" echo "$grepper -i $* $list" | bash -; fi }