RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks for the advice. I would've thought about that sooner or later, but better sooner than later. And this is not on a high traffic site, in fact only a few select folks know about it. Anyhow, hows this... my $manpage = param("manpage"); if ($manpage =~ /^([-\@\w.]+)$/) {

Re: system call question

2001-05-02 Thread Kevin Meltzer
On Wed, May 02, 2001 at 04:20:49PM -0500, J. Patrick Lanigan ([EMAIL PROTECTED]) spew-ed forth: [snip] > my $manpage = param("manpage"); > my @output = `man $manpage | perl -pe 's/(?:.\cH)//g'`; #Thanks Paul Please read perlsec and untaint $manpage (by hand, or with

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Man, this list rocks, and I am really atarting to love this language. Thanks for all your suggestions. Ultimately, Paul is the winner :) The code follows works wonders: #!/usr/bin/perl -w use strict; use CGI qw(:standard); print header(), start_html("Online Manpag

Re: system call question

2001-05-02 Thread Paul
--- Casey West <[EMAIL PROTECTED]> wrote: > On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: > : Thanks to Paul and Mike for the quick response. > : > : Now, does anyone know how I can trim out the unwanted charecters > from the > : output of a man page so that I can display i

Re: system call question

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: : Thanks to Paul and Mike for the quick response. : : Now, does anyone know how I can trim out the unwanted charecters from the : output of a man page so that I can display it in a browser? Well, you could use the man2html utili

clean up man output (was Re: system call question)

2001-05-02 Thread Me
This group is great, but sometimes deja's still the best source! ;> http://groups.google.com/groups?q=%22man+output%22+perl > Now, does anyone know how I can trim out the unwanted charecters from the > output of a man page so that I can display it in a browser? > > Sample as is: > > NNAAMMEE

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks to Paul and Mike for the quick response. Now, does anyone know how I can trim out the unwanted charecters from the output of a man page so that I can display it in a browser? Sample as is: NNAAMMEE ls - list directory contents SSYYNNOOPPSSIISS llss [_O_P_T

Re: system call question

2001-05-02 Thread Mike Lacey
yep -- and backticks sets $? with the return code as well, so you get both if you want. - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: "J. Patrick Lanigan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:4

Re: system call question

2001-05-02 Thread Paul
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote: > Now that I have CGI working with apache on my server, I am > experimenting. > Anyhow, I wrote the following script and was wondering how to capture > the output of a system call. I am trying to capture the output so that > I can format it for

Re: system call question

2001-05-02 Thread Mike Lacey
Patrick, Put your command in backticks and set a variable to its output (like this $var = `man $manpage`;) - Original Message - From: "J. Patrick Lanigan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:25 PM Subject: system call question > Now that I have C