The UNIX and Linux Forums  

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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Having a problem with a FTP Script using perl scottzx7rr Shell Programming and Scripting 6 12-19-2007 02:26 PM
strange net::SFTP Perl module debug entry csgonan Shell Programming and Scripting 2 10-11-2007 03:04 PM
PERL script problem caddyjoe77 Shell Programming and Scripting 5 07-06-2007 11:29 AM
Problem executing setuid script in perl-5.8.6 sarmakdvsr Shell Programming and Scripting 0 08-22-2005 11:11 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2006
Registered User
 

Join Date: Mar 2006
Posts: 10
Question Perl script strange problem

Hi All,
I have one strange problem in perl script. Bellow is the contents of the script i am trying to write:

#!/usr/local/bin/perl

my $module_list = '';
my @running_module;
my $count=0;
my $flag=0;
my $ccprojecthome=$ENV{CCPROJECTHOME};
@module_list = `cat $ccprojecthome/product/$ENV{CCPROD}/$ENV{CCPRODVER}/config/abp_$ENV{CCPRODVER}_modbo.dat | cut -f2 -d" "`;
$size = @module_list;
print "\n First element $moddule_list[0] \n";
print "\n Lenght of the array $size \n";
@running_proj_list=`cat $ccprojecthome/module/ac/v650/config/module_profile | grep -v PROJ | grep -v Base | cut -f1 -d" "`;
foreach $md (@module_list)
{
print "\n Module $md \n";
@running_proj_list=`/usr/bin/cat $ccprojecthome/module/$md/$ENV{CCPRODVER}/confing/module_profile | grep -v PROJ | grep -v
Base | cut -f1 -d" "`;
if ( $? != 0 )
{
print "Command failed \n";
exit 1;
}
}
print "\n List of projects \n";

print " @running_proj_list ";

now the problem is that when i comment the whole for loop and execute script it will run properly but with for loop it is not working and giving error
please help me to get out of this problem.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-27-2006
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,435
What's the error?
Reply With Quote
  #3 (permalink)  
Old 11-23-2006
Registered User
 

Join Date: Mar 2006
Posts: 10
Info required for tcsh script

Hi All,

Is it possible to "switch" like this in tcsh?

switch ( "$var" )
case "1" || "2" :
set something
breakesw
case "4" || "5" || "6" :
set otherthing
breakesw
endsw
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0