473,503 Members | 3,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pearl: how would I send router command output to a varaible and a file

2 New Member
Folks,

I'm trying to execute a command on a router and then storing that output to a variable e.g. $output..I don't know how to do it in Pearl..Any help would be appreciated in this regard.

Thanks
-Babar
Aug 3 '10 #1
4 1980
chaarmann
785 Recognized Expert Contributor
$output=$router->execute($ACommand);
Aug 3 '10 #2
Oralloy
988 Recognized Expert Contributor
Babar,

How is the script supposed to connect to the router? Serial port? Telnet? HTTP?

Please give us some real information, if you want help.

Cheers
Aug 3 '10 #3
Babar Farooq
2 New Member
Thanks for the pointer....I've connected to router via telnet....This is what I used to do in TCL, but don't know how would we do in Perl..

set output [$router exec "sh run | inc trap"]

Thanks
Babar
Aug 4 '10 #4
Oralloy
988 Recognized Expert Contributor
I'd recommend the Net::Telnet.pm module. You can find it on CPAN here.

Hopefully that gets you off the ground.
Aug 4 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2243
by: BadOmen | last post by:
I am using this to send am command to WinAmp and it works, The Open File(s) is opening but my program halts until I presses the Open or Cancel button. I think my program is waiting for a returned...
1
5538
by: andy.t.chou | last post by:
I need to be able to have a hidden field (signiture) with each output html file generated. # (Get the first and last name from the html form) $first_name = $q->param('FirstN'); $last_name =...
4
3159
by: lkrubner | last post by:
I'd like to write a PHP script to be used from the command line on a Unix machine. I'd like for the script to put together a string, turn it into a web page, print it, then return control the...
0
1370
by: Herb Green | last post by:
We have just recently went from V7 to V8.1 fixpack 3. I do most of my work using the Command Center gui and use the "Log command in history file" option as an audit trail of the commands that I...
3
10000
by: A.M | last post by:
Hi, How can I run an OS command and have the command's output (to stdout) in my string variable? For example in windows, this command should return a list of files within
1
3662
by: John Pye | last post by:
Hi all I am trying to set up a python script to manage backups of a mysql database the 'right way' using pipes. I want to send the output of the 'mysqldump' command to a file. Using a normal...
1
1814
by: ramadeviirrigireddy | last post by:
I need a unix shell script where if u issue a command then it should ask for one dir name and file name and whn input is given it should search for that file with the current date and if tht file is...
1
6368
by: dragrid | last post by:
would like to read and parse certain fields from multiple lines ( say lines 5 and 9 and the first and sixth fields respectively) from the variable of the file the command output created tried this...
8
4614
by: sganeshsvk | last post by:
sir, i want to transfer the file and folders from Linux OS to WindowsXP OS... plz send Linux Command for transfer file and folders from Linux OS to WindowsXP OS ...
0
1430
by: sganeshsvk | last post by:
sir, i want to transfer the file and folders from Linux OS to WindowsXP OS... plz send Linux Command for transfer file and folders from Linux OS to WindowsXP OS ...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.