Setting Variables in expect Scripts From Shell Output

Martin McCormick martin at dc.cis.okstate.edu
Tue Feb 26 14:04:33 UTC 2008


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


More information about the freebsd-questions mailing list