okay, heres the thing
I'm creating a script that I can use to create users. no, this is not a homework assignment or whatever it may seem. i'm just trying to master shell programming.
how can I pass arguments in a file to useradd?????
when i say arguments, I mean, all the arguments and options that is needed to create a user.
I would post my script on here but its just too much to type considering my linux system is installed on a separate hard disk and going back to restart my comp and waiting for it to boot up would be ridiculous
i will post the little bit i remember from the script so if you can help me from the information I supply, please do:
echo -n "Enter user Comment: "
read comment
echo -n "Enter user's home directory: "
read hdirectory
echo -n "Enter user's group: "
read group
echo " "
useradd -c "$comment" -d $hdirectory -g $group
note: (remember, this isn't the whole script)
the question is, how do I save the options and arguments that come after the useradd command in a file and then have the options passed to useradd so useradd can act upon it.
also, how can I have the user go back to the previous prompt when making a user. say, am creating a user using the full version of the script i posted above, how can the user go back to the previous prompt and correct his/her mistake.
to the Admins, Please do not delete or close this thread. THIS IS NOT AN HOMEWORK OR JOB ASSIGNMENT OR ANYTHING THAT GOES AGAINST YOUR POLICY.
THANKS IN ADVANCE