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
tnat64
TNAT64(1) General Commands Manual TNAT64(1)NAME
tnat64 - Shell wrapper to simplify the use of the tnat64(8) library to transparently allow an application to connect to IPv4 hosts via
NAT64 on IPv6-only systems when the application doesn't support IPv6 itself.
SYNOPSIS
tnat64 [application [application's arguments]]
or tnat64 [on|off]
or tnat64
DESCRIPTION
tnat64 is a wrapper between the tnat64 library and the application what you would like to run through NAT64.
OPTIONS
[application [application's arguments]]
run the application as specified with the environment (LD_PRELOAD) set such that tnat64(8) will transparently forward all connec-
tions to the NAT64 via IPv6
[on|off]
this option adds or removes tnat64(8) from the LD_PRELOAD environment variable. When tnat64(8) is in this variable all executed
applications are automatically NAT64-ed. If you want to use this function, you HAVE to source the shell script from yours, like
this: "source /usr/bin/tnat64" or ". /usr/bin/tnat64"
Example:
". tnat64 on" -- add the tnat64 lib to LD_PRELOAD
". tnat64 off" -- remove the tnat64 lib from LD_PRELOAD
[show|sh]
show the current value of the LD_PRELOAD variable
<without any argument>
create a new shell with LD_PRELOAD including tnat64(8).
AUTHOR
This script was created by Tamas SZERB <toma@rulez.org> for the Debian package of tsocks. It (along with this manual page) have since been
adapted into the main tsocks project and modified, and then modified to be used with tnat64.
TNAT64TNAT64(1)