Scripting help - Ubuntu

This is a discussion on Scripting help - Ubuntu ; I'm trying to get this script to work: #!/bin/sh #-------- # Command line thesaurus BROWSER="/usr/bin/lynx -source" WEBSITE="http://thesaurus.reference.com/search?q=$1" HTML2TEXT="/usr/bin/html2text -style compact" if test $1; then ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER} else echo "Usage: $0 word" exit 1 fi but when ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Scripting help

  1. Scripting help

    I'm trying to get this script to work:

    #!/bin/sh
    #--------
    # Command line thesaurus

    BROWSER="/usr/bin/lynx -source"
    WEBSITE="http://thesaurus.reference.com/search?q=$1"
    HTML2TEXT="/usr/bin/html2text -style compact"

    if test $1; then
    ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER}
    else
    echo "Usage: $0 word"
    exit 1
    fi

    but when I execute it, all it does is return to the command prompt.

  2. Re: Scripting help

    Kester writes:

    > I'm trying to get this script to work:
    >
    > #!/bin/sh
    > #--------
    > # Command line thesaurus
    >
    > BROWSER="/usr/bin/lynx -source"
    > WEBSITE="http://thesaurus.reference.com/search?q=$1"
    > HTML2TEXT="/usr/bin/html2text -style compact"
    >
    > if test $1; then
    > ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER}
    > else
    > echo "Usage: $0 word"
    > exit 1
    > fi
    >
    > but when I execute it, all it does is return to the command prompt.


    The most obvious solution is generally the one ....

    Try defining PAGER :-; And you would better off asking things like this
    in a more dedicated irc channel or newsgroup IMO.

  3. Re: Scripting help

    On Sun, 30 Dec 2007 14:35:57 +0000, Kester wrote:

    > I'm trying to get this script to work:
    >
    > #!/bin/sh
    > #--------
    > # Command line thesaurus
    >
    > BROWSER="/usr/bin/lynx -source"
    > WEBSITE="http://thesaurus.reference.com/search?q=$1"
    > HTML2TEXT="/usr/bin/html2text -style compact"
    >
    > if test $1; then
    > ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER}
    > else
    > echo "Usage: $0 word"
    > exit 1
    > fi
    >
    > but when I execute it, all it does is return to the command prompt.


    What is $PAGER set to?


  4. Re: Scripting help

    Kester wrote:

    > I'm trying to get this script to work:




    > but when I execute it, all it does is return to the command prompt.


    If you get it working, I'd love a copy of it. (:

    --
    Little Girl

    There is no spoon.

+ Reply to Thread