Menu system scripting
I dont know if this should go in programming, feel free to move it if needed.
I have a number of "widgets" that I have built a shell script menusystem around and was wondering whether someone can point me in the right direction about finding some answers to some of the following queries I have. 1) I want to be able to create an account that can only use this menu system when it logs in. That side of it is not too much trouble, but how do I ensure that when they exit the menu, they are logged out of the system totally? 2) On a related issue, how do I stop them issuing a ctrl+C (or any other escape character sequence) to exit the script? 3) And I know this is pretty unimportant to the functionality, but is there a guide to text formatting? I wouldnt mind making it a little bit clearer with colour or two, bold text that sort of thing. 4) I've run into a number of options for building menus (PS3/case, read and so on) but is there a guide that anyone knows of setting out the options available? I've been using PS3/case to date, but while it is easy for a n00b like me to figure out, it seems very restrictive in how the menu is formatted and there was not much behind the reasoning for using it in the original site I found suggesting other than it seems to be the easiest to set up, but I'd like a bit more flexibility if possible. Thanks in advance |
These are the questions I can answer:
1) Change the login shell in the /etc/passwd file for the user to be the name of the script. When the script exits the shell will exit. 2) You can capture signals in a script like this. This one captures ^C or SigInt. Code:
#!/bin/sh 4) Donno Yes, this is probably a programming post. Not much newbie content here. |
Thanks for your help, got the important questions answered at least :-)
|
All times are GMT -5. The time now is 03:29 PM. |