From owner-freebsd-questions Fri May 9 21:52:39 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA17627 for questions-outgoing; Fri, 9 May 1997 21:52:39 -0700 (PDT) Received: from alpha.lasalle.edu (alpha.LASALLE.EDU [139.84.10.250]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id VAA17621 for ; Fri, 9 May 1997 21:52:33 -0700 (PDT) Received: by alpha.lasalle.edu; (5.65/1.1.8.2/20Feb96-0556AM) id AA15006; Sat, 10 May 1997 00:52:38 -0400 Date: Sat, 10 May 1997 00:52:38 -0400 (EDT) From: Artem Koutchine To: questions@freebsd.org Subject: Custom shell questions (programming) Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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