I remember many years (decades) ago using a system where one could say something like:
$ realname:newname A B C
and the program would be invoked with argv = { "newname", "A", "B", "C" }
.
I don't remember what shell this was though.
Does such a capability exist in any current shells?
UPDATE:
exec -a
looked like it was what I wanted, but I'm getting inconsistent behaviour depending upon the program's language (yes, I know it's awful code):
$ cat argv.c && cc argv.c
int main(int argc, char **argv) { printf("<< %s >>\n", argv[0]); }
$ (exec -a fake ./a.out)
<< fake >>
It works fine in "C", but not in python:
$ cat argv.py
#!/usr/bin/python3
import sys
print("<<", sys.argv[0], ">>")
$ (exec -a fake ./argv.py)
<< /home/ray/test/argv.py >>