title: Echo current filename into a text file ubuntu?
body: <p>I normally just browse around and not looking to post questions however I am currently learning how to shell script and I've fallen into a pickle.</p>
  <p>At the moment I have a structure of:</p>
  <pre><code>Main
  ---Hub1
  ---Hub2
  ---Hub3
  ---Hub4
  </code></pre>
  <p>All the way to Hub20.</p>
  <p>What i want the structure to be is:</p>
  <pre><code>Main
  ---Hub1
  --------Notes_1.txt &gt;&gt; &quot;The &lt;file_name&gt; belongs to &lt;user&gt; and was created in Hub1&quot;
  ---Hub2
  --------Notes_2.txt &gt;&gt; &quot;The &lt;file_name&gt; belongs to &lt;user&gt; and was created in Hub2&quot;
  </code></pre>
  <p>and so on.
  At the moment my code is looking like this</p>
  <pre><code>i=1
  until (($i&gt;20))
  filename=&quot;~/Main/Hub${i}/Notes_$i.txt&quot;
  do 
  touch ~/Main/Hub${i}/Notes_$i.txt
  echo &quot;The $(basename -- &quot;$filename&quot;) belongs to $USER was created in the Hub${i}&quot; &gt;&gt; ~/Main/Hub${i}.txt
  ((i++))
  done
  </code></pre>
  <p>Its not doing what it needs to be doing and I just cant figure out what I am doing wrong. I am aware it's not formatted right. It may be a simply solution or maybe I am completely off. I want to get it working before I start moving it around. Any advice would be great. Thank you!</p>