News for hackers. Stuff that matters.
Re:Unix's special way of marking login shells goes back to V... by hhvn on Sunday December 11, 2022 @08:40AM (#33943072)
See the exec family of functions, e.g. execl:

  int execl(const char *pathname, const char *arg, ...);
Normally you would call it like execl("program", "program", "argument", NULL), duplicating the program's name/path, but it's possible to set the 2nd argument, which corresponds to argv[0] (in the case of execl), to something different. This behaviour just isn't always exposed in the shell and other languages.
Re:Unix's special way of marking login shells goes back to V... by sureglymop on Sunday December 11, 2022 @08:50AM (#33943147)
Interesting, thank you! I don't know why i had it stuck in my head that you would provide exec with the path and then the args starting from argv[1].