csh & .login
Gary Weimer 253-7796
weimer at garden.ssd.kodak.com
Wed Apr 10 00:19:24 AEST 1991
In article <1890 at umvlsi.ecs.umass.edu>, breck at 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 at ssd.kodak.com ( Gary Weimer )
More information about the Comp.unix.shell
mailing list