ActiveState Community

setting a variable

Posted by dave_mairs on 2008-02-07 13:20

I am telneting from my pc to an HPUX box, I am then attempting
to set a variable with the results of grep.
Here is the code I'm trying:
set SS [send "grep 'ROCK' /tmp/$PF\n\r"]
put "$SS"

I can tell from the history log on the HPUX box that the grep command is
working but the variable SS is not being set? Where Am I going wrong?
What do I need to do to fix the problem?

Thanks,

Dave

jeffh | Fri, 2008-02-08 18:46

The send does not return the value, you have to 'expect' the result instead.