Contributed by infoninja
on May 24, 2000 at 20:09 UTC
> programs and processes
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 ?
|Answer: How do I prevent the command/parameters in a system call from displaying in ps|
contributed by comatose
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.
Please (register and) log in if you wish to add an answer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||