On Mon, 25 Mar 2002, Blake Thornton wrote:

> > >Q: How do I make perl run programs in a given directory?
>
> So, what now happens is that all the output from running tex is displayed
> on the webpage.  How do I redirect the output from this to /dev/null ?
> (So, I still want it to create a .dvi file, but I want all the tex
> debugging info to not be displayed).
>
> I tried running
> system("cd /path/to/latex/files; latex filename.tex > /dev/null");
>
> and that didn't work.

I'm guessing it's output to stderr you are still seeing. Try

chdir("/path/to/latex/files") or die "chdir failed: $!\n";
my $rc = system("latex filename.tex > /dev/null 2>&1");

Perl uses sh as it's shell IIRC, so you need use redirection syntax that
works with sh (in other words, ways that may work in bash on the command
line won't always work in your script's system calls).

If there is anything of interest in that output that you might want to
examine from within your script, you could redirect to a file, or use open
to execute latex and read the output - open(OUT, "latex filename.tex|").

hth
charles



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to