[TriLUG] Perl. Help. Needed.

William Sutton william at trilug.org
Wed Mar 11 15:52:43 EDT 2009


Hmm... so print CONFIG the stuff you want in the CONFIG file, print STDERR 
the stuff you want on your screen, and let Expect use STDOUT?

William Sutton


On Wed, 11 Mar 2009, Greg Brown wrote:

> Hum... and when you redirect STDOUT it appears that the expect commands stop
> communicating from the script to the Expect.pm process.  Interesting.
>
> On Wed, Mar 11, 2009 at 3:42 PM, Greg Brown <gwbrown1 at gmail.com> wrote:
>
>> Yes, that's true, I could do that but that would capture the entire output
>> for the script which is quite involved; capturing only the desired output
>> would be much more clean.
>>
>> But I'm about ready to write some "------MARK------" lines into the file
>> and strip out everything outside those marks.
>>
>> But that's a last resort.  This can be done.. somehow.
>>
>> Greg
>>
>>
>> On Wed, Mar 11, 2009 at 3:38 PM, <shawn.taylor at gpi.com> wrote:
>>
>>> I am by no means a perl or expect guru, but why can't you do something
>>> like:
>>>
>>> ./script.pl > myfile.out
>>>
>>> Since the script uses the expect module, there should be no required user
>>> interaction no?
>>>
>>> Shawn
>>>
>>> Greg Wrote:
>>>
>>> Let me step back and take a breather.. how do I redirect the output of
>>> this
>>> command:
>>>
>>> print $ssh "exec \"show run\"\r";
>>>
>>> I think I've tried everything.  I'm open to any and all suggestions.
>>> --
>>> TriLUG mailing list        :
>>> http://www.trilug.org/mailman/listinfo/trilug
>>> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>>>
>>
>>
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



More information about the TriLUG mailing list