searching your organization address book from command line
Let’s assume that you are working in a relatively small organization, 4-5 hundreds people at most. I’m sure you have some kind of intranet and there’s a phone book there. I’m pretty sure you have a page with most used phone numbers pinned on your wall somewhere.
Here’s idea how to search those phones from command line. The solution is based on two scripts. First downloads the names list and formats it as necessary (mine strips all HTML mumbo-jumbo). This one is called periodically by cron. Second is used for names list search.
Here are the scripts:
update_tel_db#! /bin/sh
cd /your/path/to/database
wget http://your.path.here/file.here >& /dev/null
touch tel.txt ; \rm tel.txt
links -dump file.here | grep @ | grep -v — ——————– | grep -v mailto | grep -vi ‘Click here’ | grep -v javascript | grep -v IMG | grep -v file: | tr ‘|’ ‘ ‘ | sed ’s/^ *//’ | sed ’s/ / /g’ | sed ’s/\[[0-9]*\]//g’ > tel.txt
\rm file.here >& /dev/null
touch tel.txt
tel#! /bin/bash
echo ‘NAME DPT OFFICE CELL-PHONE HOME E-mail’
grep -i $1 /tour/path/here/tel.txt
Now telephone search becomes tel name on the command line.
Enjoy

