thendal
Programmer
- Aug 23, 2000
- 284
How to run a unix command from a web page...
I have unix command in the following path(solaris env) /opt/sys/rtool
this command helps to administer a portal software.
Here is the perl script to invoke the unix command
If i run this perl script in command line it works. If i run this from a web page gives me the following error message..
ERROR: TP_ROOT is not set. Set TP_ROOT in the shell environment or in $HOME/.tprc and rerun rtool.
TP_ROOT is /opt/sys i have added that in $ENV{'PATH'} is there something i am missing here...
Any suggestion or tips will be highly appreciated.
Thanks,
I have unix command in the following path(solaris env) /opt/sys/rtool
this command helps to administer a portal software.
Here is the perl script to invoke the unix command
Code:
#!/usr/bin/perl
use CGI;
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/opt/sys';
$op=new CGI;
print $op->header;
$userid=$op->param('userid');
chomp($userid);
$out=`/opt/sys/rtool enable account $userid`;
print "<h4>Result: $out </h4>";
If i run this perl script in command line it works. If i run this from a web page gives me the following error message..
ERROR: TP_ROOT is not set. Set TP_ROOT in the shell environment or in $HOME/.tprc and rerun rtool.
TP_ROOT is /opt/sys i have added that in $ENV{'PATH'} is there something i am missing here...
Any suggestion or tips will be highly appreciated.
Thanks,