http://www.perlmonks.org?node_id=14579

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

I'm putting coding a perl program that needs to use system() a number of times. In a couple of the uses of system(), I need to, if possible, prevent a listing from appearing in the output of what shown if 'ps a' is run at the same time that the command in system() is running. Is there any way to do this in perl ?

Originally posted as a Categorized Question.

  • Comment on How do I prevent the command/parameters in a system call from displaying in ps

Replies are listed 'Best First'.
Re: How do I prevent the command/parameters in a system call from displaying in ps
by comatose (Monk) on May 25, 2000 at 21:53 UTC

    No matter what, the command you are trying to run is going to show up in the process list. ps parses the /proc information and formats it nicely and will show everything running no matter what you might do in perl (assuming you don't use hacked versions of ps and top).

    The only way to keep command arguments from showing is to use open() and pipe your arguments to it through STDIN. There might be some potential for obfuscation, but that's about it.