Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by infoninja (Friar)
on May 24, 2000 at 20:09 UTC ( #14579=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2021-04-21 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?