Sponsored Content
Top Forums Shell Programming and Scripting Cannot execute Unix command in a simple perl script Post 302558452 by jayachandran87 on Friday 23rd of September 2011 03:07:43 PM
Old 09-23-2011
Thanks for your response..
Code:
$ vgdisplay vgesar | grep -i 'Free PE' | awk '{print $NF}'
69

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...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Net::SSH::Perl->Execute any unix command & display the output in a proper form

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)
Discussion started by: gsprasanna
2 Replies

2. Shell Programming and Scripting

Execute in unix not in PERL

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)
Discussion started by: adaleru
15 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

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)
Discussion started by: kpddong
2 Replies

4. Shell Programming and Scripting

how to execute ksh simple shell script without creating .sh file

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)
Discussion started by: Sooraj_Linux
7 Replies

5. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

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)
Discussion started by: torchij
16 Replies

6. Shell Programming and Scripting

execute ssh command via perl

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)
Discussion started by: vpundit
3 Replies

7. UNIX for Dummies Questions & Answers

Execute a command in different directory through Unix Script

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)
Discussion started by: diva_thilak
6 Replies

8. Shell Programming and Scripting

Using UNIX command in perl script.

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)
Discussion started by: Devesh5683
1 Replies

9. Linux

How to execute a simple select script using a shell script?

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)
Discussion started by: pamsy78
1 Replies

10. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

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
VGDISPLAY(8)						      System Manager's Manual						      VGDISPLAY(8)

NAME
vgdisplay - display attributes of volume groups SYNOPSIS
vgdisplay [-A|--activevolumegroups] [-c|--colon] [-d|--debug] [-h|--help] [--ignorelockingfailure] [-P|--partial] [-s|--short] [-v[v]|--verbose [--verbose]] [--version] [VolumeGroupName...] DESCRIPTION
vgdisplay allows you to see the attributes of VolumeGroupName (or all volume groups if none is given) with it's physical and logical vol- umes and their sizes etc. vgs (8) is an alternative that provides the same information in the style of ps (1). OPTIONS
See lvm for common options. -A, --activevolumegroups Only select the active volume groups. -c, --colon Generate colon separated output for easier parsing in scripts or programs. N.B. vgs (8) provides considerably more control over the output. The values are: 1 volume group name 2 volume group access 3 volume group status 4 internal volume group number 5 maximum number of logical volumes 6 current number of logical volumes 7 open count of all logical volumes in this volume group 8 maximum logical volume size 9 maximum number of physical volumes 10 current number of physical volumes 11 actual number of physical volumes 12 size of volume group in kilobytes 13 physical extent size 14 total number of physical extents for this volume group 15 allocated number of physical extents for this volume group 16 free number of physical extents for this volume group 17 uuid of volume group -s, --short Give a short listing showing the existence of volume groups. -v, --verbose Display verbose information containing long listings of physical and logical volumes. If given twice, also display verbose runtime information of vgdisplay's activities. --version Display version and exit successfully. SEE ALSO
lvm(8), vgs(8), pvcreate(8), vgcreate(8), lvcreate(8) Sistina Software UK LVM TOOLS 2.02.44-cvs (02-17-09) VGDISPLAY(8)
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy