Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

System command silent screen

by uvnew (Acolyte)
on Oct 10, 2010 at 15:31 UTC ( [id://864489]=perlquestion: print w/replies, xml ) Need Help??

uvnew has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, I am running a perl script which uses 'system' to run (in a loop) a system executable file. The executable program produces a lot of text rubbish on the screen which I do not need: is there any way to have it run "quietly", without any screen text? Many thanks for any advice!

Replies are listed 'Best First'.
Re: System command silent screen
by moritz (Cardinal) on Oct 10, 2010 at 15:44 UTC
    On Linux you can redirect the output (and error stream) to /dev/null, on Windows to NUL (iirc). If the program writes directly to the console, that doesn't work, but luckily that's only very seldom the case.

    Since you didn't tell us the operating system, it's a bit of a guesswork.

    Perl 6 - links to (nearly) everything that is Perl 6.
      Many thanks Moritz. I am using Ubuntu. Sorry for being slow (I don't use Perl often), but what should be the actual command line for redirecting the system command screen output?
        system "$command @arguments >/dev/null 2>&1" and die "...";
        Perl 6 - links to (nearly) everything that is Perl 6.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://864489]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-29 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found