On Thursday 30 Oct 2003 5:11 pm, Yannick Warnier wrote: > Le jeu 30/10/2003 à 17:56, Gary Stainburn a écrit : > > You can write $0 as well as reading it, which will change what appears > > when you run ps etc. > > > > This can be usefull for security reasons such as hiding sensitive data > > passed on the command line, and also for returning status information for > > daemons. > > How? Could you explain that for me? > > Thanks, > Yannick
security if you have the script: mylogon -u username -p password and someone (doesn't have to be root) runs ps ax they will see the command line that started the process, including your username and password. by having the command $0='mylogon -u xxxx -p xxxx'; near the top of your script the data is hidden from prying eyes. For the daemon use, I have things like while (1) { $0='mydaemon - sleeping'; $in=<PIPEHANDLE>; $0='parsing request'; etc. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]