From owner-freebsd-questions Mon Jan 22 10: 2:10 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.enteract.com (mail.enteract.com [207.229.143.33]) by hub.freebsd.org (Postfix) with ESMTP id 8F92B37B69F for ; Mon, 22 Jan 2001 10:01:51 -0800 (PST) Received: from shell-1.enteract.com (jrs@shell-1.enteract.com [207.229.143.40]) by mail.enteract.com (8.9.3/8.9.3) with ESMTP id MAA16144 for ; Mon, 22 Jan 2001 12:01:50 -0600 (CST) (envelope-from jrs@enteract.com) Date: Mon, 22 Jan 2001 12:01:50 -0600 (CST) From: "jrs@enteract.com" To: freebsd-questions@freebsd.org Subject: newbie bash scripting Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Quick question. I currently am writting a script that will login to a router and perform a command. I want to accept variables and process them. I want it do something like this: $./getconfig -i 10.1.1.8 -u oper -p LooT -t cisco -e enabler. (i for ip address, u for username, p password, t device type and e the enable password) Then "getconfig" would accept the entry and process accordingly. SO far I'm stuck witht this: #! /usr/local/bin/bash # #script defaults # usage param usage="Usage: getme -i -u -p -t -e enable......" while getopts ":i:u:p:t:e" opt; do case $opt in i ) ip=$OPTARG ;; u ) user=$OPTARG ;; p ) password=$OPTARG ;; t ) type=$OPTARG ;; e ) enable=$OPTARG ;; \? ) echo $usage exit 1 ;; esac done shift $(($OPTIND - 1)) # pass on to expect. The problem is that I want to use this information to expect into a router and perform the needed commands but how would I invoke expect (silently) within the shell script. JRS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message