Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: script

by odie (Sexton)
on May 23, 2001 at 23:15 UTC ( #82683=note: print w/replies, xml ) Need Help??

in reply to How do I add a new Unix user?

While quite possible, the question remains, why? There already is a quite useful little widget called "adduser" that probably comes with most unix systems. It's quite effective.
If you want to do it manually, I THINK this would suffice:
  • Create the user home directory: Copy /etc/skel to /home/username
  • Add the user entry to /etc/passwd and /etc/passwd- (if using shadow passwords)
  • Dito for the users group: /etc/group and /etc/group-
I think that would be enough. Then again, I am not quite sure.


I am a manual signature virus. Copy me please!

Replies are listed 'Best First'.
Re: Re: script
by Anonymous Monk on May 24, 2001 at 00:38 UTC
    There already is a quite useful little widget called "adduser" that probably comes with most unix systems

    useradd is, I believe, more common than adduser (on my machine, adduser is symlinked to useradd).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://82683]
[Lady_Aleena]: Good morning Corion, I hope you have a wonderful day as well. 8)
[Corion]: Yesterday I encountered an interesting data structure problem. I have a remote program that emits events, and my client listens for these events with one-shot callbacks, that is, I register the callback and if the event gets generated that callback ...
[Lady_Aleena]: robby_dobby, every day. Chaos is my life with few controls.
[Corion]: ... gets called once. The data structure for that is just a hash of arrays, mapping the event type to a queue of registered one-shots, and the first one-shot from the queue gets removed and called.
[Corion]: But now I want to register a one-shot for two events, of which only one will arrive, so my data structure doesn't work anymore...
[Lady_Aleena]: Corion, ouchy.
[Corion]: (maybe I should write this up as a SoPW) - currently, the "most efficient" data structure I come up with is a single array which I scan for the first fitting one-shot. Not efficient but I don't expect more than five outstanding one-shots anyway
[choroba]: can't you create a meta-key corresponding to the disjunction of the events?
[robby_dobby]: Corion: Heh. This whole thing smells of Strategy Pattern or MVC pattern.
[Corion]: And performance linear to the number of registered one-shots doesn't feel that bad. Maybe I should collect statistics on how many callbacks are outstanding ;)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-05-29 07:52 GMT
Find Nodes?
    Voting Booth?