Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!spool.mu.edu!uunet!ispd-newsserver!garden.ssd.kodak.com!weimer From: weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) Newsgroups: comp.unix.shell Subject: Re: csh & .login Message-ID: <1991Apr9.141924.22890@ssd.kodak.com> Date: 9 Apr 91 14:19:24 GMT References: <1890@umvlsi.ecs.umass.edu> Sender: news@ssd.kodak.com Reply-To: weimer@ssd.kodak.com Distribution: usa Organization: Eastman Kodak Co.; Rochester, NY Lines: 32 In article <1890@umvlsi.ecs.umass.edu>, breck@risky.ecs.umass.edu (Liam Breck) writes: |> I've RTFM (and it is indeed a F awful M, grrrrr) to no avail... Is it |> possible to invoke (from a running sh or csh) a non-login csh that |> sources .login and then prompts for input as always? (Analagous to |> bash -login.) You need to call /bin/csh with a leading '-'. There are two ways to do this. Both should work from sh and csh. 1) use links: % ln -s /bin/csh ~/bin/-csh % rehash #assuming ~/bin is in path % -csh NOTE: this will not work if run as ~/bin/-csh. It must start with '-'. 2) use execl(3V) in a C program: main() { execl("/bin/csh", "-/bin/csh", (char *) 0);} I prefer to do error checking, so I use: main() { execl("/bin/csh", "-/bin/csh", (char *) 0); perror("execl failed:"); exit(1); } in SunOS 4.1.1 on a sun4 under X11R4, I get: /dev/ttyp1: Not owner but it is not a problem later, just an inconvenience. weimer@ssd.kodak.com ( Gary Weimer )