help using shell scripts as command line args
Moderator: General Moderators
help using shell scripts as command line args
I am building a functionality that takes in sheel script as command line args. In my logic i want to be able to open up a shell script which contains one line of code (comma delimitted commands) , read the line of code, and go into the proper function. I am basically converting perl code to php. Plese help.....thanks
my perl script gets a shell script posted to it. I am now trying to use the exec function....example:
$str=exec("bin/ship.sh");
print "<table cellpadding='10' cellspacing='10' border='1'>";
if(strlen($str)>1){
print"<tr><td bgcolor='#fff000'>present</td></tr>";
}else{
print"<tr><td bgcolor='#cc0000'>Not present</td></tr>";
}
print "</table> ";
exec doesnt seem to open the file and return anything...........i wanna know if there is a better way to execute a shell script using php.
$str=exec("bin/ship.sh");
print "<table cellpadding='10' cellspacing='10' border='1'>";
if(strlen($str)>1){
print"<tr><td bgcolor='#fff000'>present</td></tr>";
}else{
print"<tr><td bgcolor='#cc0000'>Not present</td></tr>";
}
print "</table> ";
exec doesnt seem to open the file and return anything...........i wanna know if there is a better way to execute a shell script using php.
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany