There are a few possible answers to this, but in the particular case where one shell script calls another program or script at the end, the answer is easy. Use exec: #!/bin/bash # Do stuff here ... # ...
$ ps -ejH PID PGID SID TTY TIME CMD ... 1396 1396 1396 ? 00:00:00 sshd 28281 28281 28281 ? 00:00:00 sshd 28409 28281 28281 ? 00:00:00 sshd 28410 28410 28410 pts/0 00:00:00 bash 30968 30968 28410 pts/0 ...