lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] Lynx on Linux / automating a search via a script or macro


From: Thorsten Glaser
Subject: Re: [Lynx-dev] Lynx on Linux / automating a search via a script or macro
Date: Sat, 21 Jan 2017 14:05:01 +0000 (UTC)

Michael Jones dixit:

>I want to automate a Google search for "foo bar."

Put this into your shell initialisation file:

# GooGle Search
ggs() {
        local _q _IFS

        _IFS=$IFS
        IFS=+
        _q="$*"
        IFS=$_IFS
        ${BROWSER:-lynx} 
"http://www.google.com/search?hl=la&pws=0&num=100&safe=off&q=$_q";
}

Then:

$ ggs foo bar

This assumes a POSIX-compatible shell which also supports
the “local” command (as, for example, /bin/sh on Debian
must support). If yours doesn’t have it, replace it with
“typeset” (ksh93) or remove the line altogether.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]