title: Bash - Remove last word from grep output
body: <p>I am grepping certain folders using grep and awk</p>
  
  <pre><code>ls $HOME/.../ | grep ...| gawk -F "-" '{print $3}'
  </code></pre>
  
  <p>This produces 3 folders</p>
  
  <p>rp1 rp2 rp3</p>
  
  <p>rp3 is the latest. I want to remove rp3 from that variable and delete the older ones one by one using rm -rf</p>