As i said am just starting with perl. this is one block. Am trying to use perl, as i ll have difficulties comparing floating point values in shell script.
I have already tested this with shell script and works fine. but i just want to know why the same unix command gives the same result as executed in a shell script
---------- Post updated at 12:37 AM ---------- Previous update was at 12:35 AM ----------
As requested by you am pasting the vgdisplay $A
$A here is vgesar -> vgdisplay vgesar
Code:
$ vgdisplay vgesar
--- Volume groups ---
VG Name /dev/vgesar
VG Write Access read/write
VG Status available, exclusive
Max LV 255
Cur LV 1
Open LV 1
Max PV 100
Cur PV 2
Act PV 2
Max PE per PV 1599
VGDA 4
PE Size (Mbytes) 32
Total PE 3198
Alloc PE 3129
Free PE 69
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
Last edited by Scott; 09-23-2011 at 04:22 PM..
Reason: Code tags...
Net::SSH::Perl ...... how to print the output in a proper format
my $cmd = "ls -l";
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd("$cmd");
print $stdout;
the script works fine, but i am unable to see the output... (2 Replies)
Hi All,
This below command is working fine with unix box. However i could not able
to run it in PERL. kidly suggest???
perl -ne '{push @x, $_}END{pop(@x); print @x}' create2.txt (15 Replies)
so in unix this command works works and shows me a list of directories
find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt
but when i try running a perl script to run this command
my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
please help me to execute a simple shell script like
for i in `ls
echo $i
done
. i dont want to create a new sh file to execute it. Can i just type and execute it ? because I always this kind of simple for loops .
Please help .
Thanks (7 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
Hi I have a perl command that doesn't seem to be working correctly. It appears to be fine but even when i try and run it manually same thing. Can someone take a look at this and tell me what they think the problem could be?
Here is the perl Line:
system ("echo 'ssh -t -t $user\@$_ \"cd... (3 Replies)
Hi Gurus,
I have the below requirement,
Execute an unix script which will pick the latest file from the archive directory and do a grep (on multiple patterns) on that file.
processingDir="/usr/apps/irdc/informatica/spsf_sales/TgtFiles/ARCHIVE"
filename = 'ls Check* | sort -n -k 2 |... (6 Replies)
I wish to know if there is any limitation in using unix commands in perl script or it is just we should avoid using them in our perl script.
For e.g Below is the command to get the recent file in a dir.:
$lcsvFile = `cd "$l_inputfilepath";ls -1t *.CSV|tail -1`
Is there any harm in coding... (1 Reply)
Hi team,
I have two select statements and need to run them using SYSDBA user
select * from temp_temp_seg_usage;
select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from
dba_segments where segment_name='TEMP_TEMP_SEG_USAGE';
Need to run this using a shell script say named... (1 Reply)
I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open())
I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
LEARN ABOUT DEBIAN
speedy
SPEEDY(1p)SPEEDY(1p)NAME
speedy - a persistent Perl interpreter
SYNOPSIS
speedy [ <perl options> ] [ -- <speedy options> ] [ <filename> ]
DESCRIPTION
speedy, short for SpeedyCGI, is a way to run perl scripts persistently, which can make them run much more quickly. The most common way to
make a script run persistently is by changing the interpreter line at the top of the script from:
#!/usr/bin/perl
to
#!/usr/bin/speedy
After the script is initially run, instead of exiting, the perl interpreter is kept running. During subsequent runs, this interpreter is
used to handle new executions instead of starting a new perl interpreter each time. A very fast frontend program, written in C, is exe-
cuted for each request. This fast frontend then contacts the persistent Perl process, which is usually already running, to do the work and
return the results.
Each perl script runs in its own Unix process, so one perl script can't interfere with another. Command line options can also be used to
deal with programs that have memory leaks or other problems that might keep them from otherwise running persistently.
Although SpeedyCGI is especially useful for CGI scripts, it can be used to keep any perl script running persistently. See CGI::Speedy-
CGI(3.pm) for a complete description of SpeedyCGI, including further details on CGI execution and Apache issues. This manual page is based
on that, but concentrates on running speedy from the command line.
OPTIONS
The speedy command line is the same as for regular perl, with the exception that SpeedyCGI specific options can be passed in after a "--".
For example the line:
#!/usr/bin/speedy -w -- -t300
at the top of your script will set the perl option `-w' and will pass the `-t' option to SpeedyCGI, setting the Timeout value to 300 sec-
onds.
The options can also be set at run-time from the perl script using the CGI::SpeedyCGI module.
OPTIONS AVAILABLE
See CGI::SpeedyCGI(3.pm) for a complete description of the options.
-p<string>
BackendProg : Path to the speedy backend program. (Default: /usr/bin/speedy_backend)
-B<number>
BufsizGet : Use <number> bytes as the maximum size for the buffer that receives data from the perl backend. (Default: 131072)
-b<number>
BufsizPost : Use <number> bytes as the maximum size for the buffer that sends data to the perl backend. (Default: 131072)
-g<string>
Group : Allow a single perl interpreter to run multiple scripts. See CGI::SpeedyCGI(3.pm) for details. (Default: `none')
-M<number>
MaxBackends : If non-zero, limits the number of speedy backends running for this perl script to <number>. (Default: 0)
-r<number>
MaxRuns : Once the perl interpreter has run <number> times, re-exec the backend process. Zero indicates no maximum. This option is
useful for processes that tend to consume resources over time. (Default: 500)
-t<number>
Timeout : If no new requests have been received after <number> seconds, exit the persistent perl interpreter. Zero indicates no
timeout. (Default: 3600)
-T<string>
TmpBase : Use the given prefix for creating temporary files. This must be a filename prefix, not a directory name. (Default:
`/tmp/speedy')
-v Version : Print the SpeedyCGI version and exit.
ENVIRONMENT
Environment variables can also be used to pass in options. This can only be done before the initial execution, not from within the script
itself. The name of the environment variable is always SPEEDY_ followed by the option name in upper-case. For example to set the speedy
Timeout option, use the environment variable named SPEEDY_TIMEOUT.
FILES
/tmp/speedy* A unix socket used to connect to the backend process. See speedy_backend(1) for more information.
AUTHOR
Sam Horrocks
http://daemoninc.com
sam@daemoninc.com
NOTES
This manual page was created by Niko Tyni <ntyni@iki.fi> for Debian GNU/Linux, because the original program does not have one. It is based
on the original and more complete CGI::SpeedyCGI(3pm) manual page.
BUGS
There are command-line parsing incompatibilities with the real Perl. These aren't very easy to fix, as even the perlrun manpage isn't
quite accurate on which parameters can be separated (like '-I') and which can't (like '-C'). speedy doesn't allow any of them to be sepa-
rated. It considers the first option without a leading dash as the script filename.
SEE ALSO perl(1), CGI::SpeedyCGI(3pm), speedy_backend(1)SPEEDY(1p)