title: bin/bash nested loop does not work
body: <p>I currently working as a intern at a hosting firm. They asked me to write a bin/bash script to help automate a process to check the user's domain's and .pointers for them. And validate with a "whois" command if the domains/pointers are on our server's.</p>
  
  <p>I'm new with bin/bash scripting but i was told i should check nested loops out. So to test my script out i made similar paths as they would look like on the server. <code>/usr/local/directadmin/data/users/#USER#/domains.list</code> and <code>users/#USER#/domains/#DOMAIN NAME OF USER#.pointers</code></p>
  
  <pre><code>#part 1 
  for i in $(cat /home/MrC/Desktop/Users)  #&lt;the list of users i need to check)
  do
      if [ -f "/usr/local/directadmin/data/users/$i/domainlist.txt" ]
      then
          echo "/usr/local/directadmin/data/users/$i" &gt;&gt; /home/MrC/Desktop/output.tx$
          cat "/usr/local/directadmin/data/users/$i/domainlist.txt" &gt;&gt; /home/carlos/Des$
      fi
  
      #part 2 
      for s in $(cat /home/mrC/Desktop/output.txt)
      do
          if  [ -f "/usr/local/directadmin/data/users/$i/domains/$s.pointers" ]
          then
              echo "/usr/local/directadmin/data/users/$i" &gt;&gt; /home/MrC/Desktop/pointers.$
              cat "usr/local/directadmin/data/users/$i/domains/$s.pointers" &gt;&gt; /home/MrC$
          fi
      done
  
  done
  </code></pre>
  
  <p>So part 1 works this is the output.txt below</p>
  
  <pre><code>    /usr/local/directadmin/data/users/testuser
      lolla.nl
      blaat2.nl
      blaat3.nl
      google2.nl
      /usr/local/directadmin/data/users/testusers
      blaat.nl
      google.com
      test.nl
      pietje.nl
  </code></pre>
  
  <p>But i cant seem part two to work (no pointer file). my goal with part two of the script is to read the output (domainname) and put it <code>@/$i/domains/$s.pointers</code>.</p>
  
  <p>I'm new on the forum i hope i asked my question in a proper fashion. if some one could give me hints/tips to which direction i should look that would be highly appreciated. </p>