date='d15' date='m3' date='y' words='unix linux shell bash' site='codesnippets.joyent.com' open -a Safari "http://www.google.com/search?q=${words// /+}&as_qdr=${date}" open -a Safari "http://www.google.com/search?q=site%3A${site}%20${words// /+}&as_qdr=${date}" # sbd - search by date # cf. also http://codesnippets.joyent.com/posts/show/1700 function sbd() { declare date site words date="${1}" words="${2}" site="${3}" if [[ $# -eq 2 ]]; then /usr/bin/open -a Safari "http://www.google.com/search?q=${words// /+}&as_qdr=${date}" elif [[ $# -eq 3 ]]; then /usr/bin/open -a Safari "http://www.google.com/search?q=site%3A${site}%20${words// /+}&as_qdr=${date}" else return 1 fi return 0 } sbd d 'unix linux shell bash' sbd m5 'unix linux shell bash' sbd y3 'unix linux shell bash' codesnippets.joyent.com
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Limit Google searches by date (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» ws - web search from the com... in shell osx mac search bash unix commandline web
» ws - search the web from the... in shell osx mac search bash command line unix web cmdparser libidn
» Simple internet traffic summ... in awk shell osx mac bash unix web internet traffic summary tcpdump
» Enable access to specified w... in shell osx mac bash unix web ipfw firewall internet access traffic website pipestatus
» Enable internet traffic via ... in awk shell osx mac bash unix web port ipfw firewall internet access traffic
» Block internet traffic to sp... in shell osx mac bash ip unix web internet access route traffic website localhost ipaddress block blackhole
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails