How to change argv0 in bash so command shows up with different name in ps? How to change argv0 in bash so command shows up with different name in ps? bash bash

How to change argv0 in bash so command shows up with different name in ps?


You can do it when running a new program via exec -a <newname>.


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


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].