From owner-freebsd-questions@FreeBSD.ORG Mon Feb 25 20:22:04 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB3C616A400 for ; Mon, 25 Feb 2008 20:22:04 +0000 (UTC) (envelope-from raggen@passagen.se) Received: from av12-1-sn2.hy.skanova.net (av12-1-sn2.hy.skanova.net [81.228.8.185]) by mx1.freebsd.org (Postfix) with ESMTP id A379F13C459 for ; Mon, 25 Feb 2008 20:22:04 +0000 (UTC) (envelope-from raggen@passagen.se) Received: by av12-1-sn2.hy.skanova.net (Postfix, from userid 502) id B986B388E3; Mon, 25 Feb 2008 20:55:30 +0100 (CET) Received: from smtp4-1-sn2.hy.skanova.net (smtp4-1-sn2.hy.skanova.net [81.228.8.92]) by av12-1-sn2.hy.skanova.net (Postfix) with ESMTP id 9C20737EC5; Mon, 25 Feb 2008 20:55:30 +0100 (CET) Received: from [192.168.1.31] (81-231-91-25-no41.tbcn.telia.com [81.231.91.25]) by smtp4-1-sn2.hy.skanova.net (Postfix) with ESMTP id 4F72137E4C; Mon, 25 Feb 2008 20:55:30 +0100 (CET) Message-ID: <47C31D30.6000104@passagen.se> Date: Mon, 25 Feb 2008 20:55:28 +0100 From: Roger Olofsson User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Martin McCormick References: <200802251620.m1PGKl4w069144@dc.cis.okstate.edu> In-Reply-To: <200802251620.m1PGKl4w069144@dc.cis.okstate.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Setting Variables in expect Scripts From Shell Output X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 20:22:04 -0000 Martin McCormick skrev: > While running an expect script, is it possible to set an > expect script variable to the string kept in a shell variable? > > I can generate the shell variable just fine but when I > try to export it to the expect script for later use with something like: > > set LOGFILENAME [exec echo \$TMPFILE] > > something happens without error, but a later attempt to see the > contents of it such as > > send_user "$LOGFILENAME\n" > > proves that it never got set. It just echoes the literal string > LOGFILENAME. > > Thanks. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > If you're not too worried about speed my old trick to circumvent this was to simply write the variable to a temporary file then read in that file for the send_user thing later on...Providing the send_user is a script, mind you. Just my nickels worth...remember to delete the tempfile though. /R