title: Named pipe swallowing first field of Linux command output
body: <p>I'm trying to parse the output of the Linux df tool for use in a machine status report. I'm using almost identical code to parse the output of the ps tool and it works fine (all fields are available in read loop) but in the code below the first field output from awk (percentUsed) is missing when I read from the named pipe.</p>
  <pre><code>#!/bin/sh
  
  mkfifo dfPipe0
  IFS=&quot; &quot;
  df -h | awk '{ print $6&quot; &quot;$3&quot; &quot;$7&quot; &quot;$1 }' &gt; dfPipe0 &amp;
  while read -r percentUsed size mountedOn fileSystem
  do
    printf &quot;%s\n&quot; &quot;${percentUsed} | ${size} | ${mountedOn} | ${fileSystem}&quot;
  done &lt; dfPipe0
  rm dfPipe0
  </code></pre>
  <p>Sample df + awk output</p>
  <pre><code>$ df -h | awk '{ print $6&quot; &quot;$3&quot; &quot;$7&quot; &quot;$1 }'
  Use% Size Mounted Filesystem
  0% 1.9G /dev devtmpfs
  - 0 /sys/kernel/security securityfs
  4% 1.9G /dev/shm tmpfs
  $
  </code></pre>