/**************************************************************/ /* */ /* UNIX 1 / WS 92/93 Gruppe ux803 */ /* 6. Uebung - Aufgabe 4 - msh.c */ /* */ /* Vorname Name Matrikelnr. */ /* --------- ------- ------------- */ /* Dietmar Dierks 125761 */ /* Roman Czyborra 127221 */ /* Torsten Buller 117894 */ /* Gerasimos Paliatsaras 140956 */ /* */ /**************************************************************/ #include "5/msh.h" #include int shellpid; void main () { static char buf [BUFLEN], *res; static struct kommando *k, *kp; signal (SIGINT,SIG_IGN); signal (SIGQUIT,SIG_IGN); signal (SIGTSTP,SIG_IGN); signal (SIGTTIN,SIG_IGN); signal (SIGTTOU,SIG_IGN); shellpid = getpid (); setpgrp (shellpid, shellpid); while (1) { do_wait (-1, 0); show_prompt (); res = readline (buf, BUFLEN); if (!res) { putchar ('\n'); return; } for (k = kp = parseline (buf); kp; kp = kp -> next) if (!do_builtin (kp)) do_command (kp); forget (k); } }