This is a discussion on how to add group of users from an input file within the Shell scripting forums, part of the Development/Scripting category; I am using Fedora 9 linux. I am wondering how can I add a group of users from an input ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
I am using Fedora 9 linux. I am wondering how can I add a group of users from an input file (plan text file) and specify that the script can only be executed by administrator or users with administartors right. I have been trying some codes such as this but im not sure if its right or wrong.
vi file1.sh cat userlist | while read xyz do useradd "$xyz" done and then I made vi userlist and added the names such as Tom, sue, pat, Joe in it then ./file1.sh to execute it. another code is: vi file2.sh cat $1 | while read username fullname do useradd -c "$fullname" "$username" done then i created vi userlist4 and added the names such as: Tom Hanks, Joe mason, Jim Joseph. then executed using cat /etc/passwd command. so i want to know which code is the right one to add a group of users from an input txt file??? If none of the above code is right could you please provide me with a code. thanks. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Putting multiple users in one group in one shot | hrishikesh | Shell scripting | 2 | 06-23-2008 08:41 PM |
| Interpreting ~ from user input | al001 | Shell scripting | 2 | 04-21-2008 09:27 PM |
| Add multiple users to a group | chuckbeattie | Linux software | 2 | 11-03-2007 12:04 AM |
| curses Problems with Non-Blocking input | kgmf | Coding in General | 3 | 04-01-2005 02:49 PM |
| Program gets aborted on large input | Ssk | Linux software | 7 | 03-14-2005 12:04 PM |