Hiding command-line args? 
Author Message
 Hiding command-line args?

I had thought that perl could hide its command line args
(from ps, for instance) in much the same way as C programs
can, by resetting argv[] values.  However, all I could
find in the camel book was faking exec'd program command
lines.

Can You Do It In Perl?

$foo="/bin/echo"; exec $foo "HardAtWork", "Just another Perl hacker,";
--
Roy Johnson     Shell Development Company (but speaking for myself)
"Hooray for snakes!  Hooray for snakes!" -- The Simpsons (29 Apr 93)



Sat, 04 Nov 1995 00:22:11 GMT  
 Hiding command-line args?

Quote:

>I had thought that perl could hide its command line args
>(from ps, for instance) in much the same way as C programs
>Can You Do It In Perl?

   As a friend of mine from Germany is fond of saying, "You becha!"  You
can do it with

      $0 = "Look, Mom!  No arguments!"

   Page 114 of the camel book, "You may set $0 to some other value to
change what the ps(1) program sees as your command."
--
Russell Mosemann     Concordia College      Voice: (402) 643-7445
Computing Center     Seward, NE 68434       Fax:   (402) 643-4073
"I hesitate to articulate for fear of deviating from the path
 of rectitutde."



Sat, 04 Nov 1995 04:13:49 GMT  
 Hiding command-line args?
:    As a friend of mine from Germany is fond of saying, "You becha!"  You
: can do it with
:
:       $0 = "Look, Mom!  No arguments!"

It should also be pointed out that this only works on systems where ps
actually looks at your process's writable address space to get the arguments.

Larry



Mon, 06 Nov 1995 05:40:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. command-line args style flags from a file

2. Debug .pl Syntax of command line args ?

3. Case-insensitive Command Line Args

4. command line args not working correctly

5. HELP: How to program command line args

6. perl command line args

7. Passing Args to script via web and command line

8. perl command line args

9. Command line args..?

10. Command line args

11. Question: Perl for Windows command line args?

12. Getting command line args

 

 
Powered by phpBB® Forum Software