Bash Script Assistance
Hello,
I am in a Unix class and have been out of town so I missed some lectures. I have been tasked to generate a couple of scripts and ahve never done it before. I have a virtual machine running Ubuntu. The task is below Prompt the system administrator for all valid input parameters Generate a menu to ask which task is needed to be performed Create a UNIX group Drop a UNIX group Create a user Drop a user Prompt the system administrator for the target user name List the running processes for that user Confirm with the system administrator before killing the processes Kill the processes after confirmation I understand the commands to create users and groups and to kill processes, but I do not know how to write a scrpt to perform all of this and prompt the admin/generate menus Any help would be greatly appreciated |
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/
you will not find people doing homework for you typically on linux forums. |
write functions or if simple enough, use direct commands.
Then write a "menu" to present those choices. Menu choices call the function(s) Code:
remove_user() #I am a function http://wiki.bash-hackers.org/syntax/ccmd/case http://tldp.org/LDP/abs/abs-guide.pdf http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-8.html Have fun and Good Luck! |
Quote:
|
If you google 'bash menu select' you'll get some good examples.
eg https://askubuntu.com/questions/1705...a-shell-script As above, definitely use a function for each task. |
Thank you guys, I was not asking for someone to do it for me. Just a direction on how to add things such as the comments. Those links should do good for me.
Thank you again |
Glad to be of help.
Make us all proud! |
All times are GMT -5. The time now is 11:38 AM. |