How to change argv0 in bash so command shows up with different name in ps?
问题 In a C program I can write argv[0] and the new name shows up in a ps listing. How can I do this in bash? 回答1: You can do it when running a new program via exec -a <newname> . 回答2: Just for the record, even though it does not exactly answer the original poster's question, this is something trivial to do with zsh : ARGV0=emacs nethack 回答3: I've had a chance to go through the source for bash and it does not look like there is any support for writing to argv[0]. 回答4: I'm assuming you've got a