From owner-freebsd-questions Mon Jan 22 10:55:28 2001 Delivered-To: freebsd-questions@freebsd.org Received: from Chicago58.focal.com (unknown [205.241.28.118]) by hub.freebsd.org (Postfix) with ESMTP id 2403937B402 for ; Mon, 22 Jan 2001 10:55:06 -0800 (PST) Subject: shell scripting question To: freebsd-questions@freebsd.org X-Mailer: Lotus Notes Release 5.0.3 March 21, 2000 Message-ID: From: jsconiers@focal.com Date: Mon, 22 Jan 2001 12:54:46 -0600 X-MIMETrack: Serialize by Router on Mail_Central_01/US-Servers/FOCAL(Release 5.0.4a |July 24, 2000) at 01/22/2001 12:54:51 PM 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 am accepting variables and process them 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. How would I invoke expect (silently) within the shell script to spawn an ssh session?? JRS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message