[ILUG] Perl Question.
Niall O Broin
niall at magicgoeshere.com
Wed Jun 8 12:12:35 IST 2005
On 8 Jun 2005, at 11:11, Martin Pegman wrote:
> I have a little perl script to grab IP addresses form a hostname file
> and pass them one by one to a working expect script to pull config
> from cisco routers etc.
> If I change the system line in the script (below) and paste the single
> line output to the shell all works fine. However the perl script just
> disapears with no errors.
What do you mean exactly ? Does the perl script not actually run the
script /root/grab\-config for you?
> As you can see form the script I'm new to Perl so any pointers or
> better ways to do this are appreciated.
Well, you're escaping too much, but better too much than too little :-)
and you have a couple of tautologies, but no matter - that script
appears to do what you appear to want :-) So, the first thing to figure
out is if the expect script is actually getting called at all. the next
thing to look at is how you've split up the arguments to system - you
could try putting them all into one string.
More information about the ILUG