Re: UNIX commands inside perl script.
by "Kevin Haidl" <kevinh(at)actofmind.com>
|
Date: |
Tue, 14 Mar 2000 11:28:23 -0800 |
To: |
"Grant Peel" <tracker(at)home.com> |
Cc: |
"HWG - Languages" <hwg-languages(at)hwg.org> |
References: |
home xmission home2 |
|
todo: View
Thread,
Original
|
|
You probably used 'single-quotes'
What was recommended were `back ticks`.
The former just prints. That latter executes in a shell with the output
piped into your script. Not obvious to the eye, I agree, but that's likely
the problem.
Kevin Haidl
Act of Mind Communications
Web Assessment, Site Design, Site Production and Site Promotion
kevinh(at)actofmind.com http://www.actofmind.com (604) 734-5098
----- Original Message -----
From: "Grant Peel" <tracker(at)home.com>
To: "Doran L. Barton" <fozz(at)xmission.com>
Cc: "HWG - Languages" <hwg-languages(at)hwg.org>
Sent: March 14, 2000 10:11 AM
Subject: Re: UNIX commands inside perl script.
> That didn't work. Just shows the words in the browser window.
>
> Thanks anyway!
>
> -Grant
>
> ----- Original Message -----
> From: "Doran L. Barton" <fozz(at)xmission.com>
> To: "Grant Peel" <tracker(at)home.com>
> Cc: "HWG - Languages" <hwg-languages(at)hwg.org>
> Sent: Tuesday, March 14, 2000 12:11
> Subject: Re: UNIX commands inside perl script.
>
>
> > Not long ago, Grant Peel proclaimed...
> > > A quick queston for anyone who knows perl well.
> > >
> > > How do I call a system (UNIX BSDI) command from inside a perl script
and
> > > have it display back in the browser?
> > >
> > > Example..inside an html page, shtml actually, i have an SSL command:
> > >
> > > <!--#EXEC CGI="/cgi-bin/command.cgi"-->
> > >
> > > then, in the command.cgi, i have something like:
> > >
> > > #!/usr/bin/perl5
> > >
> > > print "Content-type: text/html\n\n";
> > > print "Current Server Processes:\n\n";
> > > print | exec('ps x -u');
> > >
> > >
> > > The idea is t be able to show the current server processes from a web
> page.
> > >
> > > Any Ideas?
> >
> > print `ps x -u`;
> >
> > -=Fozz
> >
> > --
> > Doran L. Barton = fozz(at)xmission.com && http://www.xmission.com/~fozz/
> > ** Dynamic web developer, Perl hacker. Using the Internet since 1990.
**
> > "That year, 2000, will be the biggest hole in the status quo since 1977
> and
> > 1989." -- Bruce Sterling, Oct 1998, SF, CA (I was there when he said
> it!)
>
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA