Question: command args using ps

Question: command args using ps

Post by Paul Lon » Sat, 14 Mar 1998 04:00:00



If I use ps to get a list of currently running programs, I get the program
names not any parameters that may be have been included.

Is there any way of getting the whole command line (or the args relevant to
each command)?

(I am currently running Solaris if that makes a difference)

Thanks in advance

Paul Long
Forbio Research
Indooroopilly  Qld
Australia

 
 
 

Question: command args using ps

Post by Paul Lon » Sat, 14 Mar 1998 04:00:00


Ignore the previous post.

I guess I use ps -f.

Paul

 
 
 

1. how to set argv command line args for ps

[SunOS 5.8 Generic_117350-06]

I would like to write a C program (actually a library module for
python, but that's not important here) which changes it's argv, i.e.
which changes the
way it's arguments are shown by the "ps" command.  When my application
loads
a new top-level data object, I want the data's name to show in the "ps"
listing.

This works easily under linux:

 #include <unistd.h>
 #include <string.h>
 main(int argc, char **argv) {
    strcpy(argv[1], "XXX");
    sleep(120);  /* go and look at "ps" output */
 }

gcc -o mytest mytest.c
./mytest aaaa bb &

ps -o args 4391
COMMAND
./mytest XXX  bb

How can I do this under solaris?

--- George

2. Buslogic - cant enable BIOS!

3. PS command, args truncated?

4. How to remove a logical interface?

5. How to get ps info from C program without using ps command

6. rpm & kpackage

7. CGI commands with command line args?

8. awk problem

9. RESOLVED: awk question => checking command line args.

10. awk question => checking command line args.

11. How to view the args of a program in ps when it goes to (name) ?

12. Using "ps" command on Solaris 2.2

13. ps args trucation