Answers to: I made a google cli function for .bashrc - is there a better way to do this?http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this<ol> <li>install elinks</li> <li>put the following in your .bashrc</li> </ol> <p>function google { /usr/bin/links g:"$1 $2 $3 $4 $5 $6 $7 $8"; }</p> <ol> <li>use/examples:</li> </ol> <p>$ google 2*4 $ google 1 dollar in euros $ google translate aller $ google weather </p> <ol> <li>I cannot believe I have created the best way to do this?</li> </ol>enTue, 18 May 2010 16:51:12 -0400Answer by joe 1http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/644<p>Nathan.</p> <p>I agree, the google command line from a browser is hot:</p> <p><a href="http://goosh.org/" rel="nofollow">http://goosh.org/</a></p> <p>Thanks</p>joe 1Tue, 18 May 2010 16:51:12 -0400http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/644Answer by MaikBhttp://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/460<p>For those who enjoy using a terminal within a desktop environment and use the firefox:</p> <pre><code>function google { firefox -search "$*"; } </code></pre> <p>Thx for the inspiration!</p>MaikBTue, 11 May 2010 07:18:01 -0400http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/460Answer by jeff mcdhttp://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/449<p>sudo apt-get install elinks</p> <p>function google { /usr/bin/elinks g:"$*"; }</p> <p>for me (Ubuntu 10.04) i need to point to elinks not links. really cool though, thanks!!!</p>jeff mcdTue, 11 May 2010 03:43:30 -0400http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/449Answer by olejorgenbhttp://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/447<pre><code>function google { /usr/bin/links g:"$*"; } </code></pre> <p>Wont limit you to 8 arguments</p> <p><code>"$*"</code> is the same as <code>"$1 $2 $3 ... $N"</code> where N is the total number of arguments</p>olejorgenbTue, 11 May 2010 02:47:19 -0400http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/447Answer by Nathanhttp://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/446<p>You can shorten your function and catch more than 8 options with. </p> <p>function google { /usr/bin/links g:"$*"; }</p> <p>You might also be interested in <a href="http://goosh.org/" rel="nofollow">http://goosh.org/</a></p>NathanTue, 11 May 2010 02:46:39 -0400http://linuxexchange.org/questions/439/i-made-a-google-cli-function-for-bashrc-is-there-a-better-way-to-do-this/446