Perl help - how to assign output of perl to variable
Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command
and have the script goto each router in the hosts.router file and run the command "show version" on telnet.
Right now the script works but i have to put in the "show version" inside a variable inside the actual script like this.
How can i get that -r switch to put the "show version" from the command line into the variable when run? BTW the -r is arbitray, any switch would work.
Hi,
I am giving a grep command, and i am getting the output. i want to store it in a variable
for eg
a = grep '12345' /dir/1/2/log.txt ( the output is number)
b= grep 'basic' /dir/1/2/log1.txt (in this case the output is character)
so how to assign the output of grep to a variable
... (1 Reply)
How would I pass awk output to a perl variable?
For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct.
$test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Hi All,
I am trying to convert the below Csh code into Perl.
But i have the following error.
Can any expert help ?
Error:
ls: *tac: No such file or directory
Csh
set $ST_file = `ls -rt *$testid*st*|tail -1`;
Perl
my $ST_file = `ls -rt *$testid*st*|tail -1`; (10 Replies)
Hi,
I work in ksh88.
I have an interective script which prompts the user for the input and returns numeric value depending on the input provided. I need to call this script inside another script and then assign the resulting output the the variable.
The call like that A=`my script` obviously... (6 Replies)
Hello All,
A part of my very basic perl code requires me to read a single value from a text file.
The file output is the following:
Reading image ... done
IMAGEREGION=0x0x0-256x162x256
VOXELDIMENSION=0.9375000000x1.2000000477x0.9375000000
VOXELNUMBER=10527001... (7 Replies)
Hello,
I am writing a ksh script on an AIX system. I need to get the date and time from a file into a variable. I found the following perl script from another post on this site and modified it slightly to output the format I need:
perl -e '@d=localtime ((stat(shift)));... (4 Replies)
Hi Folks,
I am trying to assign a value from the command to a dynamic variable. But I am not getting the desired output.. I am sure something is wrong so i need experts advise.
There will be multiple files like /var/tmp/server_1, /var/tmp/server_2, /var/tmp/server_3, having different server... (6 Replies)
Hai
how can I assign directory path to a variable in perl
Thanks&Regards
kiran (3 Replies)
Discussion started by: kiran425
3 Replies
LEARN ABOUT DEBIAN
control_rancid
control_rancid(1) General Commands Manual control_rancid(1)NAME
control_rancid - run rancid for devices of a group
SYNOPSIS
control_rancid [-V] [-m mail_rcpt] [-r device_name] group
DESCRIPTION
control_rancid is a sh(1) script to parse a group's router.db(5), run rancid for each of the devices, possibly re-run rancid for devices
that failed collection, e-mail diffs, and e-mail error reports.
The command-line options are as follows:
-V Prints package name and version strings.
-m mail_rcpt
Specify the recipient of diff mail, which is normally rancid-<group>. The argument may be a single address, multiple comma
separated addresses, or -m may be specified multiple times.
-r device_name
Specify the name, as it appears in the router.db, of a particular device to collect and generate diffs for. The device must be
marked "up".
The -r option alters the subject line of the diff mail. It will begin with <group name>/<device name> rather than just the group
name alone.
control_rancid is normally (and best) run via rancid-run(1) which provides a locking mechanism on a group basis and saves output in a log
file for each group.
SEE ALSO rancid-run(1), rancid.conf(5), router.db(5)
5 October 2006 control_rancid(1)