title: How to get results of shell command line by line in for sentese?
body: <p>I am learning shell script. And I want to check size of directories(and files). I made a sample script as</p>
  
  <pre><code>#!/bin/bash
  
  for dir in $(du ".")
  do
    echo "dir = $dir"
    read T_SIZE T_PATH &lt;&lt;&lt; $dir
    echo "T_SIZE = $T_SIZE"
    echo "T_PATH = $T_PATH"
  done
  </code></pre>
  
  <p>The structure of directories under current directory has only one directory, "a".</p>
  
  <p>The results are</p>
  
  <pre><code>dir = 4
  T_SIZE = 4
  T_PATH = 
  dir = ./a
  T_SIZE = ./a
  T_PATH = 
  dir = 16
  T_SIZE = 16
  T_PATH = 
  dir = .
  T_SIZE = .
  T_PATH = 
  </code></pre>
  
  <p>It seems command "du" gives results word by word.
  However, I expected command "du" gives results line by line and I expected the results of the script above are</p>
  
  <pre><code>dir = 4
  T_SIZE = 4
  T_PATH = ./a
  dir = 16
  T_SIZE = 16
  T_PATH = .
  </code></pre>
  
  <p>Please tell me what was wrong or suggestion to me.</p>
  
  <p>Thank you very much.</p>