in reply to Appending data to a file in a specific location

Heh.. I was just about to say the same thing: Expect is good.

Can you clarify your question? Are you asking how to talk to your Cisco device or how to edit a text file? Editing the file is easy. Talking to the Cisco device is less easy.

--Pileofrogs

  • Comment on Re: Appending data to a file in a specific location

Replies are listed 'Best First'.
Re^2: Appending data to a file in a specific location
by nemasys (Initiate) on May 05, 2009 at 09:30 UTC

    Hi,

    Thanks for the reply, the end goal is to apply the changes to the actual Cisco devices. But at the moment I have a list of devices that have the ip helper-address defined and I only want to touch these configs and not any others and I need to adjust quiet a few. So the first pahse is to add the extra 2 ip helper-address to the configs and then apply these to the devices. But I do not want to apply the changes after the config adjustement as we have a product to do this but the product is not flexiiable enough to make these types of changes as to match any interface that has the ip helper address defined, so I though PERL would be the right tool for that job.

    Hope that explains things

    Kind Regards

    James

      Sorry, I still don't understand: Do you have text files on your desktop that need editing, or do you need to edit the files on the Cisco device?

      I had a system once where I needed to automatically make a change on a Cisco device during a failure state. I had a linux box attached to the Cisco device via serial cable. I used minicom to talk to the Cisco device. I wrote a perl script with expect that fired up minicom and talked to the Cisco. If it would be helpful, I could probably fish it out and you could take a look at it.

      -Pileofrogs