Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
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 ...
  1. #1
    Just 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!

  2. #2
    Just Joined!
    Join Date
    Mar 2007
    Posts
    16
    Duh. addgroup or groupadd programs. Got that one anyway.

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    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

  4. #4
    Just 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.

  5. #5
    Just Joined!
    Join Date
    Mar 2007
    Posts
    16
    Okay, I give up. What's the switch to addusers to the group when you run addgroup?

  6. #6
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    google this:
    Code:
    man addgroup Linux
    That's how I found the answer to this question.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  7. #7
    Just 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.

  8. #8
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    When I googled, I came up with this link. It explains (fortunately, quite clearly), among other things:
    1. how to create a new group; and
    2. 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.

  9. #9
    Just 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?

  10. #10
    Just 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.

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...