Newsgroups: comp.sys.hp Path: utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdlh111!joe From: joe@bwdlh111.BNR.CA (Joe Waddington) Subject: program can't change argv[0] Message-ID: <1990Nov23.001310.20327@bwdls61.bnr.ca> Sender: usenet@bwdls61.bnr.ca (Use Net) Reply-To: joe@bwdlh111.BNR.CA (Joe Waddington) Organization: Bell-Northern Research Ltd. Keywords:argv[0] Date: Fri, 23 Nov 90 00:13:10 GMT I hope someone out there can help me. I am running HP-UX 7.0 on an HP 9000/345. I wrote and compiled the following C-program hoping it would change the name that I saw when I type 'ps -ef'. It works under HP-UX 6.5 and SunOS4.0.3 and SunOS 4.1.1. any help you can give would be greatly appreciated. Thanks Joe ----------------------------cut here----------------------------- #include main( argc, argv ) int argc; char **argv; { char *p; fprintf( stdout, "prog_name is :%s.\n",argv[0]); p = argv[0]; *p++ = 'p'; *p++ = 'p'; *p++ = 'p'; fprintf( stdout, "prog_name is :%s.\n",argv[0]); } ----------------------------cut here----------------------------- ============================================================= Please remember that these opinions are mine, and mine alone. (a fact I'm not always proud to admit. :-) ) ============================================================= Joe Waddington joe@bnr.ca Bell Northern Research =============================================================