title: Issue with cut command
body: <p>I'm having issues with the cut command,</p>
  
  <p>This is an example of the original file:</p>
  
  <pre><code>userid1:john doe smith:group1
  userid2:jane doe smith:group2
  userid3:paul rudd :group2
  </code></pre>
  
  <p>The expected result:</p>
  
  <pre><code>userid1
  userid2
  userid3
  </code></pre>
  
  <p>Testing command:</p>
  
  <pre><code>#!/bin/bash
  clear
  id=`id -u`
  if [ $id -eq 0 ]
  
  for i in `cat users.txt`
  do
  userid=`echo $i|cut -d":" -f1`
  
  echo "$userid" &gt;&gt;temp.txt
  `chmod 777 temp.txt`
  done
  </code></pre>
  
  <p>This gives me this output:</p>
  
  <pre><code>userid1
  doe
  smith
  userid2
  doe
  smith
  userid3
  rudd
  </code></pre>
  
  <p>If I erase the space between the name and last name, it works, and I'm specifying ":" as delimiter, dunno what I'm missing.</p>
  
  <p>How can I get the expected result?</p>
  
  <p>Cheers.</p>
  
  <p>UPDATE: Fixed changing for loop to while...read.</p>