1

There is a field in process object in node.js: process.title

That field allows you to change process name displayed in top or ps command on linux.

Is there some way to do this for and in bash script also?

ElSajko
  • 1,612
  • 3
  • 17
  • 37
  • Does this answer your question? [How to change argv0 in bash so command shows up with different name in ps?](https://stackoverflow.com/questions/3251550/how-to-change-argv0-in-bash-so-command-shows-up-with-different-name-in-ps) – stark Apr 19 '21 at 13:09

1 Answers1

0

Changing the command line reference from running processes is possible on *NIX with /proc filesystem :

$ ps
  PID TTY          TIME CMD
  106 tty4     00:00:01 bash
  719 tty4     00:00:00 ps
$ echo "toto" > /proc/106/comm
$ ps
  PID TTY          TIME CMD
  106 tty4     00:00:01 toto
  719 tty4     00:00:00 ps
$

And yes, it's not the prettiest way to do so.

Zilog80
  • 2,534
  • 2
  • 15
  • 20