|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Modifying command lineby turo (Friar) |
| on May 12, 2008 at 00:58 UTC ( [id://686014]=note: print w/replies, xml ) | Need Help?? |
|
As grinder said: "there will always be a race condition between the moment the kernel launches your program and the point in time at which you'll be able to set $0 to something else.".
Anyways If you still want to hide your command line, I have a solution for you :)
It consists on saving the command line in an environment variable when the process start and then exec the same program without any arguments. Doing this, you will pass the arguments on the environment variable to the new process.
Here I show you a little program, that you can execute (e.g. myprogram -arg1 -arg2 234 -private "secret"), and try to see if you can use ps -ef to show its command line arguments.
Hope it helps.
perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||