demo.c:
#include <unistd.h>
#include <string.h>
int main(int argc, char *argv[]) {
strcpy(argv[0], "frob");
sleep(100);
}
Terminal 1: $ make demo
cc demo.c -o demo
$ ./demo --greppable
Terminal 2: $ ps aux|grep greppable
luke 25858 0.0 0.0 2164 752 pts/0 S+ 00:32 0:00 frob o --greppable
luke 25931 0.0 0.0 8192 2356 pts/5 S+ 00:32 0:00 grep --color=auto greppable
$ cat -v /proc/25858/cmdline
frob^@o^@--greppable^@$No comments yet.