![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep help | flood | Shell Programming and Scripting | 3 | 06-05-2008 10:14 PM |
| Grep | Aejaz | UNIX for Advanced & Expert Users | 3 | 04-30-2008 04:10 AM |
| grep | dineshr85 | Shell Programming and Scripting | 1 | 10-10-2007 01:52 AM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| Make grep -c display like grep -n? | Jerrad | Shell Programming and Scripting | 2 | 08-24-2006 09:20 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ps -ef|grep help !!!!
Hi ,
I m facing a problem like the following .. I have a script a.sh which is calling an executable B by passing some command line arguments. During the process if I do a ps -ef|grep of the process , it will display the command line arguments( which includes the passwd ) . it would be great if some one can help me out in hiding the command line agruments from being displayed by grepping or any shuch commands Thanks a lot in advace Binu |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
I dont think grep or any such tools have that capability to change ps listing format.
I ran into something similiar, sometime back. Here are some possible approaches you could try. 1. Blanking out passwords i.e. argv[n] http://groups.google.com/group/comp....7044f4b8840dd6 2. A pstat solution available on HPUX 3. setproctitle() system call available only on BSD'ish systems. 4. And the legendary hide.c from Oracle. (Check for this source code on the net. This solution is fool-proof but no hack-proof). 5. Yet another possible one is: assign the password to an env variable. Once the applications starts, exec your self by reading the values from those env variables. Ofcourse, you would need to clear the env variables. 6. Or you could pick up the setproctitle implementation for linux. I dont have the link. But here is the documentation header to that file Code:
/* * setproctitle implementation for linux. * Stolen from sendmail 8.7.4 and bashed around by David A. Holland */ /* * Copyright (c) 1983, 1995 Eric P. Allman * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * . . . * From: @(#)conf.c 8.243 (Berkeley) 11/20/95 */ char setproctitle_rcsid[] = "$Id: setproctitle.c,v 1.3 1997/05/19 12:58:15 dholland Exp $"; -vino. |
||||
| Google The UNIX and Linux Forums |