Path: utzoo!attcan!uunet!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpldola!paul From: paul@hpldola.HP.COM (Paul Bame) Newsgroups: comp.sys.hp Subject: Re: ps lists command parameters Message-ID: <11870011@hpldola.HP.COM> Date: 5 Mar 90 17:50:43 GMT References: <686@mmlai.UUCP> Organization: HP Elec. Design Div. -ColoSpgs Lines: 51 'ps' gets program arguments by peeking into your program space. When you are swapped out it has to read the swap disc and may not bother so instead you get square brackets - I think... If you're just trying to obliterate your command-line arguments so others can't see them, I've used the following: main(argc, argv) int argc; char *argv[]; { char *saveit; if (argc >= 2) { saveit = argv[1]; argv[1] = "obliterated"; } } In fact, once I replaced argv[0] (normally the program name) with a string which reflected how many blocks it had processed so I could run it forever in background and conveniently check (with ps) how far it was in its task. It's kinda cheezy but was more convenient than writing a number in a file or to stdout or something. main(argc, argv) int argc; char *argv[]; { char buffer[100] = "Hi!"; int nblocks; ... argv[0] = buffer; for(...) { ... sprintf(buffer, "XX %d", nblocks); ... } } I've not done this with HP-UX for a while - and then it was on a 300 only so there's no guarantee - but it's easy enough to try. -Paul #include