LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 09-04-2010, 02:45 AM   #1
kzcom
LQ Newbie
 
Registered: Aug 2010
Posts: 25

Rep: Reputation: 0
run shell script from perl


i want to run/call shell script from perl, i used this
system( "sh", "script.sh", "--help" );
The 'script.sh' contains IPTables firewall script, but that's not run.
i test 'script.sh' with a simple thing such create a chain only, but it not doing.How to run a shell script from a Perl program?
 
Old 09-04-2010, 04:06 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Have you tried using the full paths in the command ?

Code:
system( "/bin/sh", "/path/to/script.sh", "--help");
 
Old 09-04-2010, 04:50 AM   #3
kzcom
LQ Newbie
 
Registered: Aug 2010
Posts: 25

Original Poster
Rep: Reputation: 0
yes,but didn't change
 
Old 09-04-2010, 06:47 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,688
Blog Entries: 54

Rep: Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955Reputation: 2955
Does the script have the owner rights to mess with iptables?
 
Old 09-04-2010, 08:30 AM   #5
kzcom
LQ Newbie
 
Registered: Aug 2010
Posts: 25

Original Poster
Rep: Reputation: 0
yes, it has them

Last edited by kzcom; 09-04-2010 at 08:33 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
in bash shell how to run shell script during startup rammohan04 Red Hat 2 07-31-2009 03:07 AM
I want to run script on the server from client machine in windows in a perl script vpradeep Linux - Newbie 2 09-01-2008 04:29 AM
MySQL Updates With Null When Perl Script Run From Shell Script ThisGuyIKnow Programming 6 08-12-2008 10:56 AM
how to run a shell script in the perl script sharad Linux - General 1 05-24-2006 04:23 AM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 07:25 PM


All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration