Guest User

Untitled

a guest
Feb 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. KALI,APPLE,10/20/75,Year 1
  2. STEV,BAR,06/18/75,Year 2
  3. DEREK,BEN,11/12/70,Year 1
  4. FIDE,CAST,07/04/77,Year 2
  5.  
  6. #!bin/bash
  7. echo -e "This is a shell script for Assignment02.n"
  8.  
  9. # A ssign file descriptors to username file
  10. exec 3< username.txt
  11.  
  12. # Read user and password
  13. while read iuser <&3 && read ipasswd <&3; do
  14.  
  15. # Print it here
  16. printf "tCreating user: %s with password: %sn" $iuser $ipasswd
  17.  
  18. # Create the user with adduser
  19. useradd -m -s /bin/flase $iuser
  20.  
  21. # Assign the password to the user
  22. passwd "$iuser" <<<"ipasswd"$'n'"$ipasswd"
  23.  
  24. done
Add Comment
Please, Sign In to add comment