- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Perl/CGI running external commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2005 10:39 PM
10-30-2005 10:39 PM
I am using Perl for extracting and parsing data from my server. I habe a *.cgi, which runs those lines when called:
system ("/usr/bin/perl /opt/webmin-1.230/vimod/load/testreverse.pl");
system ("/usr/local/bin/pl -png /opt/webmin-1.230/vimod/load/$script_name");
---------------------------------------------
The first call doesn't work and I wonder why? The Perl-Script has W,R,X-Rights. If I call it from the shell, there is no problem.
The second is running correctly.
Can anybody help?
Thank you!
Solved! Go to Solution.
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2005 10:49 PM
10-30-2005 10:49 PM
Re: Perl/CGI running external commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2005 11:02 PM
10-30-2005 11:02 PM
Re: Perl/CGI running external commands
$/dir/script>perl tralala.pl
Perl is in /opt/perl5/bin, but when I changed it it didn't work again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 12:13 AM
10-31-2005 12:13 AM
Re: Perl/CGI running external commands
http://www.perl.com/doc/FAQs/cgi/idiots-guide.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 12:42 PM
11-01-2005 12:42 PM
Re: Perl/CGI running external commands
Presuming you have as the first line of your script:
#! /usr/bin/perl
why would you not run:
system("/opt/webmin-1.230/vimod/load/testreverse.pl");
??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 07:09 PM
11-06-2005 07:09 PM
Re: Perl/CGI running external commands
There should not be any difference..anyway I may try this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 07:22 PM
11-06-2005 07:22 PM
Re: Perl/CGI running external commands
Get perl path as,
$PERL=`which perl`
system("$PERL <script>");
It will work.
~regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 07:43 PM
11-06-2005 07:43 PM
Re: Perl/CGI running external commands
All this means, that I don't know where am I stuck- perl programming or system administration :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 09:32 PM
11-06-2005 09:32 PM
SolutionThat is tis only system call I can see - Am I missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 09:48 PM
11-06-2005 09:48 PM
Re: Perl/CGI running external commands
sub create_data_files {
system ("rm -f /opt/webmin-1.230/vimod/load/*.tmp");
}
&create_data_files("hour");
&create_data_files("day");
&create_data_files("week");
&create_data_files("month");
Every execution will delete all .tmp files. It will keep only "month" file only at last. Do you want to delete all old files?
Remove system ("rm -f /opt/webmin-1.230/vimod/load/*.tmp"); from sub create_data_files and put it infront of,
system ("rm -f /opt/webmin-1.230/vimod/load/*.tmp");
&create_data_files("hour");
&create_data_files("day");
&create_data_files("week");
&create_data_files("month");
It will work now. Refer attachment for fresh.
~regards