title: how to add an echo to awk?
body: <p>I am having some trouble with my bash shell script which I am using to print the 6th and 10th fields of the ls -l command. It works as it is but I am unsure on how to add an echo to the end of it. It prints filename and size in bytes but I was wondering if I could get it to say 'BYTES' at the end of each line to make it clear what unit the file size is in.</p>
  
  <p>So far I have</p>
  
  <pre><code>/bin/ls -ls "$directory" | awk '{print $10,$6}'
  </code></pre>
  
  <p>That isnt the whole code obviously but the only thing relevant to my question. Do I need to assign an echo to a variable and then add it or something? I am new to bash shell scripting so I am sorry if my question is bad. </p>
  
  <p>EDIT:
  If I use the command like this</p>
  
  <pre><code>wastesizeandlist ~/dev
  </code></pre>
  
  <p>The output I get is</p>
  
  <pre><code>This directory exists
  Performing command
  wastesizeandlist 520
  </code></pre>
  
  <p>I added "BYTES" within the script as somebody suggested (apologies for forgetting your name, I can't see it right now). The output now is</p>
  
  <pre><code>This directory exists
  Performing command
    BYTES
  wastesizeandlist 520 BYTES
  </code></pre>
  
  <p>Which is almost there. Apart from the BYTES under the performing command echo.
  I am trying to get it to look like this</p>
  
  <pre><code>This directory exists
  Performing command
  wastesizeandlist 520 BYTES
  </code></pre>
  
  <p>And I know we shouldn't be parsing the output of ls but I have an assignment which requires me to get the file size and names of all files in a directory. If there is a better way to this, it would be appreciated if you could tell me. </p>
  
  <p>EDIT:
  If I try -lsR, I get an output like this</p>
  
  <pre><code>Filename:     Size:  BYTES
  Filename: wastesizeandlist   Size: 520 BYTES
  Filename: test     Size: 4096 BYTES
  Filename:        Size:  BYTES
  Filename:        Size:  BYTES
  Filename:        Size:  BYTES
  Filename: 1      Size: 5 BYTES
  </code></pre>
  
  <p>Here test is a sub directory and 1 is a file within that sub directory. What I am asking now is how would I remove the line which appears at the start and the lines which appear before a new directory? I tried the command on another directory and it has the same issue. A seemingly nameless and sizeless file at the start and then 3 after going into a subdirectory? All help would be appreciated.</p>
  
  <p>EDIT:</p>
  
  <p>Just changed tail -n +2 to +3 and it removes the first line. How would I remove the other empty lines and put the output into proper spaced out columns?</p>