title: Reading username and password from file
body: <p>I'm looking at a away of reading the username and password of a file and inputing those to either add user or delete user.</p>
  
  <p>EG: I have a file named 'userlist' with the following content with this format:</p>
  
  <pre><code>user1 pass1
  user2 pass2
  user3 pass3
  </code></pre>
  
  <p>What I don't understand completely is how to use BASH script to add these accounts.</p>
  
  <p>What I have so far is this:</p>
  
  <pre><code>if [[ whoami -ne "root" ]]
  then
  exit
  else
  echo "wish to add or delete? a/d"
  read uArg
  echo "enter file name"
  read uFile
  if [ $uArg = "a" -o $uArg = "A" ]
  then
      IDK WHAT TO DO HERE.
  elif [ $uArg = "d" -o $uArg = "D" ]
  then
     IDK WHAT TO DO HERE.
  fi
  fi
  </code></pre>
  
  <p>Alright, what I don't understand is how to read each word line by line and input the username and password to add a new user or delete an existing user.</p>
  
  <p>The program is ment to read the whole file and add each user with there corrosponding password. If delete is chosen then it deletes each user within the file.</p>
  
  <p>I'm new to BASH so any help would be greatyl appreciated.</p>