What is correct way to exec /bin/csh for interactive mode

From: <siegelr_at_teleport.com>
Date: Wed, 1 Mar 1995 20:03:29 -0800

We have a program that we use to perform some "housekeeping" functions before
users enter their /bin/csh shell. Their /etc/passwd entry points to this
program which execs /bin/csh after it's finished doing its housekeeping stuff.
 It works fine on ULTRIX but when we tried it on OSF/1 V2.0 /bin/csh executes
but doens't run the .login script. /bin/csh apparently isn't executing in
"interactive" mode. What do we need to change to make it execute csh in
interactive mode?

The following C code fragment calls /bin/csh:

strcpy(argv[0],"-");
ipoint = envp;
do {
     if (strstr(*ipoint,"SHELL="))
       {
          strcpy(*ipoint,"SHELL=/bin/csh"); break;
       }
    } while (*++ipoint);
execve("/bin/csh", argv, envp);

I assume it has something to do with the "-" but I'm not sure how it wants me
to pass it.

Thanks in advance

Rich Siegel
siegelr_at_teleport.com
Received on Wed Mar 01 1995 - 23:04:17 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT