title: username and pass login loop bash
body: <p>the loop gets initiated even though the if statement does as well which makes no sense, but i am very new to bash so not a lot of things make sense to me</p>
  
  <pre><code>first=0
  echo enter your username
  read user
  log1=$(grep -q $user username_pass.txt)
  
  echo enter your password
  read pass
  log2=$(grep -q $pass username_pass.txt )
  
  if [ $log1=0 ] &amp;&amp; [ $log2=0 ];
  then
      echo Welcome
      first=1
  fi 
  
  while [ $log1=1 ] || [ $log2=1 ];
  do 
      echo wrong user name or password
      echo enter your username
      read user
      echo enter your password
      read pass
  done
  
  if [ $log1=0 ] &amp;&amp; [ $log2=0 ] &amp;&amp; [ first=0 ];
  then
      echo Welcome
  fi
  </code></pre>