Skip to content | Skip to navigation
Apr 24, 2003 03:24 # 11007
jdonnell *** (3) posts about...
This is a little script I wrote that I thought someone else might find usefull. I do a lot of work from the terminal and this script saves me a little bit of time here and there. It will open your default browser and do a search in google on the terms you passed from the terminal.
From the terminal type:
google your search terms
where 'your search terms' is what you want to search for.
I don't think this will work in linux. I don't believe linux has the open command, but I'm not really sure.
I can give more detailed instructions if anyone needs more help.
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: chkargs argument..." 1>&2
exit 1
fi
for term in $@
do
search="$search+$term"
done
url="http://www.google.com/search?q=$search"
#echo $url
open "$url"
I don't think this will work in linux. I don't believe linux has the open command, but I'm not really sure.
Linux has an "open" command, but it does something completely different. To use your script on linux, you can substitute "open" with your favourite browser's name, such as:
/usr/bin/mozilla ${url} &
-marc