Hello
I've inherited some code which allows me to give users a menu to run certain Unix commands but which should stop them getting to the command line. My problem is this doesn't now work properly (probably never did).
As an example this is the end of a user's .profile:
# other stuff here for setting up things #
# ... #
usermenu.cexe menufile.mnu
exit
usermenu.cexe is the program (written in C) which displays the menu;
menufile.mnu is a text file which lists the menu items & the commands they invoke.
This bit works but when I do a ^C I crash out of the program to the command line. My documentation tells me that the exit at the end of the .profile will log me out if this happens but it doesn't.
(My documentation also says that the C code uses a trap command to force ^C to be ignored - but that doesn't work either.)
So my question is - is there a solution to this in the shell script? I'd rather not go back to the C code as I'm no C expert (& the person who wrote this was our last one ...). I guess I'm hoping there's some way to get the running process to run the exit before the command line is shown to the user.
Thanks, Chris
I've inherited some code which allows me to give users a menu to run certain Unix commands but which should stop them getting to the command line. My problem is this doesn't now work properly (probably never did).
As an example this is the end of a user's .profile:
# other stuff here for setting up things #
# ... #
usermenu.cexe menufile.mnu
exit
usermenu.cexe is the program (written in C) which displays the menu;
menufile.mnu is a text file which lists the menu items & the commands they invoke.
This bit works but when I do a ^C I crash out of the program to the command line. My documentation tells me that the exit at the end of the .profile will log me out if this happens but it doesn't.
(My documentation also says that the C code uses a trap command to force ^C to be ignored - but that doesn't work either.)
So my question is - is there a solution to this in the shell script? I'd rather not go back to the C code as I'm no C expert (& the person who wrote this was our last one ...). I guess I'm hoping there's some way to get the running process to run the exit before the command line is shown to the user.
Thanks, Chris