The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using Subroutine / Function in case statement sriram003 Shell Programming and Scripting 1 05-07-2009 08:38 AM
Running function or command concurrently in a bash script dj_bridges Shell Programming and Scripting 8 02-05-2009 07:58 AM
Subroutine Hung bintaleb High Level Programming 3 12-03-2008 01:03 AM
Using the passwdpolicy() subroutine. syndex AIX 0 10-02-2008 09:54 PM
chpass subroutine not updating NIS rmm47 High Level Programming 1 03-30-2007 11:30 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-19-2009
tannu tannu is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 15
Running more than one function from a subroutine

Hi All

I am new to perl so had one question.
I have one Subroutine which works as expected and below is just an example.
where I ran a command and check the output.
so my question is if I have more than one command then how to check the results, meaning I want to add more command and check the results of each one after another.Thanks for your help

example of new command can be
my $command2 = fdisl -l;
my $command3 = du -f;

========================================
sub testSub{
my $variable1 = test 123;
my $variable2 = linux;
my $command1 = uanme -a ;

if ($?) {
push (@$errors ,"uname -a is failed for $hostname" );
} else {
$Log->LogInfo("uname -a passed for $hostname");
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0