--- "Peter B. Steiger" <[EMAIL PROTECTED]> wrote: > On Tue, 2005-09-20 at 12:33 -0700, Brandin Creech wrote: > > umask 0077 > > mkdir /home/username && > > useradd -m username > > Every time you add a user? That would get old real fast if you expect > to add more than 3 users.
True. But you can wrap those commands into a shell script or a function and then use that. You can even call the function 'useradd' if you want. If you type it at the shell, your function will be used. But since functions can't be exported, no other script will mistakenly use your script instead of the real useradd command. I like to keep my function definitions in /root/functions and then make sure your .bashrc has a line that says "source ~/functions". You could define useradd like this in /root/functions: useradd() { /sbin/useradd "$@" || exit $? while [ "$2" != "" ] do shift done chmod 0700 "/home/$1" } That assumes the last argument given to useradd is the username. I think this is the only correct way to specify it to useradd, anyway. __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page