LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01: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, 03:06 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

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

Code:
system( "/bin/sh", "/path/to/script.sh", "--help");
 
Old 09-04-2010, 03: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, 05:47 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Does the script have the owner rights to mess with iptables?
 
Old 09-04-2010, 07: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 07:33 AM.
 
  


Reply



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 02: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 03:29 AM
MySQL Updates With Null When Perl Script Run From Shell Script ThisGuyIKnow Programming 6 08-12-2008 09:56 AM
how to run a shell script in the perl script sharad Linux - General 1 05-24-2006 03:23 AM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 06:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:40 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
Open Source Consulting | Domain Registration