Re: Expect Scripting

From: Richard Stearn (terhi.victor@logonet.com)
Date: Fri Jun 08 2001 - 01:20:23 EEST

  • Next message: Craig Small: "Re: mkiss lock file bug"

    Greetings Albert

    > The actual password begins and ends with $ and expect is trying to read that

    You probably need to escape the $'s. For example:

            send "\$xxxxxx\$\r"

    Rather than attempt to control ftp from an expect script I use the following method:

    --------------------------------------------------------------------------
    LOG_FILE="<log file name>"
    FTP_HOST="<ftp host name>"
    USER="user <username> <password>\n"
    SWITCHES="bin\n hash\n prompt\n"
    REMOTE="cd <remote dir>\n"
    LOCAL="lcd <local dir>\n"
    CMD="get <file>\n"
    CLOSE="bye\n"

    echo "$USER $SWITCHES $REMOTE $LOCAL $CMD $CLOSE" | ftp -n -i -v $FTP_HOST > $LOG_FILE 2>&1
    --------------------------------------------------------------------------

    And then scan the logfile for the results.

    This method I find to be more reliable than using expect to control ftp.

    -- 
    Regards
    	Richard
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Amateur radio callsign: G1SOG         Home BBS: G1SOG@GB7GLO.#46.GBR.EU
                    Amprnet co-ordinator for Wiltshire
    My opinions are mine, all mine. None to spare for unopinionated masses.
    This message comes from a WinTel free zone.   CPU = Cyrix,  OS = Linux.
    Unix is user friendly.        Just rather selective about it's friends.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to gwshlim.bhyozhcvp@relay.tunkki.fi
    



    This archive was generated by hypermail 2b30 : Fri Jun 08 2001 - 05:56:39 EEST