Thanks hiltjo!
On Jan 5, 2013 7:29 AM, "Hiltjo Posthuma" <hil...@codemadness.org> wrote:

> On Fri, Jan 4, 2013 at 10:44 PM, Carlos Torres <vlaadbr...@gmail.com>
> wrote:
> > http://sprunge.us/QMMS
> >
> > someone requested that on IRC and i had it.
> >
> > Enjoy!
> >
>
> You can also use shellscripting and do something like this:
>
> #!/bin/sh
>
> read input
> token=$(printf "%s" "$input" | cut -b 1-2)
> stuff=$(printf "%s" "$input" | cut -b 3-)
> url="$input"
> engine=""
> if [ "$token" = "g " ]; then
>         engine="https://encrypted.google.com/search?q=%s";
> elif [ "$token" = "y " ]; then
>         engine="http://www.youtube.com/results?search_query=%s&aq=f";
> elif [ "$token" = "w " ]; then
>         engine="http://wikipedia.org/wiki/%s";
> fi
>
> if [ ! "$engine" = "" ]; then
>         url=$(printf "$engine" "$stuff")
> fi
> printf "Url is: |%s|\n" "$url"
>
>
> Kind regards (and happy new year),
> Hiltjo
>
>

Reply via email to