Re: Shell-Script problems

Ion Badulescu (ionut@moisil.wal.rhno.columbia.edu)
Sat, 7 Dec 1996 20:51:45 -0500 (EST)


On Sat, 7 Dec 1996, Erik Andersen wrote:

> andersee@Dillweed% cat scum
> #!/bin/bash
> # A useless script named scum
> until [ -e /tmp/foo_does_not_exist ] ;do
> sleep 1
> done
>
> andersee@Dillweed% scum &
> [1] 1027
> andersee@Dillweed% type ps
> ps is aliased to `ps -acux '

The problem is right here; the process does appear, but as bash, not as
scum. I don't know which is the correct behavior though, as ps -aux shows
it as bash ./scum, so scum is a parameter to bash. BTW, ps -acux on SunOS
4.1.3 shows the process as bash, too...

The changes are trivial, but before changing anything I'd like to hear
what other people think about this issue - whether the name of the process
as appears in /proc/<pid>/stat should be the name of the interpreter (for
compatibility reasons) or the name of the interpreted script.

Here's the patch, in case anyone is interested...

Ionut

--
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

--- linux/fs/binfmt_script.c.old Sat Dec 7 20:47:27 1996 +++ linux/fs/binfmt_script.c Sat Dec 7 20:47:32 1996 @@ -76,7 +76,6 @@ /* * OK, now restart the process with the interpreter's inode. */ - bprm->filename = interp; retval = open_namei(interp, 0, 0, &bprm->inode, NULL); if (retval) return retval;