Results 1 to 10 of 23
Hello. I've got a problem, and I hope that some one here can help. I'm not going to lie, this is a homework assignment. I need to make a script ...
- 02-27-2008 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Multiple Operation Administrative Script-Desperately Needing help
Hello. I've got a problem, and I hope that some one here can help. I'm not going to lie, this is a homework assignment. I need to make a script with a menu that allows a user to select a number, and have the script perform that numbers corresponding function.
I've been banging my head on this for a week, and here is the problem: I don't know how to setup the menu. I'm told it should be a bunch of loops and ifs, but I can't figure out how to do it.
Also, I can't seem to recall how to set create administrative groups via CLI.
I hope that some one can help me, because this is due by 12:00 CST!
- 02-27-2008 #2Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Duh. addgroup or groupadd programs. Got that one anyway.
- 02-27-2008 #3
So you say that you're going to need ifs and loops. There is another way to do this, but let's take that approach. What are you going to have to do?
Well, you're going to need to print a menu with all of the options. You are then going to need to accept input from the user and check that input against all of the possible options until you find the right one. Do what you have to, and repeat the whole process.
Does this help you think about how to write the code?DISTRO=Arch
Registered Linux User #388732
- 02-27-2008 #4Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Actually, yes it does. I'll give it a whirl and post the result and any other problems I have here in a short while.
Thank you.
- 02-27-2008 #5Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Okay, I give up. What's the switch to addusers to the group when you run addgroup?
- 02-27-2008 #6
google this:
That's how I found the answer to this question.Code:man addgroup Linux
--
Bill
Old age and treachery will overcome youth and skill.
- 02-27-2008 #7Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Okay, I know I'm being slow, but all that i have found is how to add new users to a group once created. I need to add existing users to a new group.
- 02-27-2008 #8
When I googled, I came up with this link. It explains (fortunately, quite clearly), among other things:
- how to create a new group; and
- how to add existing users to an existing group.
Do you see how those two steps can be combined to add existing users to a new group?--
Bill
Old age and treachery will overcome youth and skill.
- 02-27-2008 #9Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Lame brain question again. I know that the useradd -e function will disable accounts at a given time, but is there a way to make them disabled without having to do that and fetch the time to make it disable right this minute?
- 02-27-2008 #10Just Joined!
- Join Date
- Mar 2007
- Posts
- 16
Found it. usermod -l works to disable it.
BTW, I'm sorry to keep posting, but I'm freaking out a little. I really do appreciate everyone's help.


Reply With Quote