Re: Setting Variables in expect Scripts From Shell Output

2008-02-26 Thread Martin McCormick
Roger Olofsson writes:
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.

An excellent idea. I just wanted to be sure I wasn't
missing something else. In this case speed isn't a problem since
what I am doing is allowing all our group to get a current copy of the
syslog file on our DHCP server when they need to look at
something and not all of them have or need accounts there so the
script uses an account that does work to get the file and then
it will hand the caller the file with all the right permissions.
To complicate things, more than one caller might use the script
simultaneously so I need to use a temporary file name and keep
track of it so that nobody clobbers anybody else's file.

All that part is done except for that last part and that
is what you helped with. Many thanks.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Setting Variables in expect Scripts From Shell Output

2008-02-25 Thread Roger Olofsson



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 [EMAIL PROTECTED]




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


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]