Date: Sat, 10 May 1997 00:52:38 -0400 (EDT) From: Artem Koutchine <koutcha1@alpha.lasalle.edu> To: questions@freebsd.org Subject: Custom shell questions (programming) Message-ID: <Pine.OSF.3.91.970510004954.15067A-100000@alpha.lasalle.edu>
next in thread | raw e-mail | index | archive | help
Hello! I am writing a menu shell for my users (we a little provider and want to simplify life for our users and at the same time take full control of them). Here is a sample code (just a skeleton from the memory): void main (int argc, char **argv, char **evp) { /* are we running as a login shell ??? */ if (*argv[0] != '-') { /* code for usual calls.. just passed to csh */ execve("/bin/csh",argv,evp); die("Can't call csh"); } else { /* init code.. prints menu does init stuff*/ i=domenu(); switch(i) { case 1: startppp(); case 2: /* user chose to enter shell*/ i=execve("/bin/csh",argv,vpe); if (i==-1) die ("cannot execute shell"); case 3: changepass(); default: dir("menu error"); } } } It work find for almost everything. The only thing ,so far, which does not work is the following line in .login tset -Q ?$TERM when i use CSH as a shell it just asks for the terminal and then does the termcap initialization and stuff, but with my shell it print all of those init command on the screen. For everything else it works just fine. Programs have no clue that it is not a csh. As i undertsand they must be printed into the stderror (that's why i don't see them with csh), but somehow with my shell stderr is redirected to stdout. On the other hand i could be wrong. Please, if you have any thoughts, share them with me! Regards, koutcha1@lasalle.edu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.91.970510004954.15067A-100000>