[sf-lug] regular expression question

James Sundquist sundquistjames at gmail.com
Fri Jun 8 13:17:46 PDT 2012


So, I wrote some aliases that rely on user input that work just fine.
alias h='history | grep $1"

I tried doing the same thing for conducting quick google searches with the
w3m pager, which can be used to browse text/html on the internet and is
included on Ubuntu Server.

$ w3m -dump -T text/html https://encrypted.google.com/search?q=news

  This will output the results of searching the term "news" on google's
search to the display. Works like a charm

alias w3mtest='w3m -dump -T text/html https://encrypted.google.com/search?q=
"$1"'

  I add this alias to bashrc and execute it with the argument "news"  and
bash will not successfully interpret the input.  It outputs the Google
search page and an additional line reading 'w3m: Can't load news'

I've written this as a function and it works perfectly.  What is stopping
this from working as an alias?  I'd love to get a fresh perspective.  I've
gotten this concept to work in elinks by creating a bookmark for google
search (g) and simply adding my search terms to the end of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20120608/8d3f8199/attachment.html>


More information about the sf-lug mailing list