title: How can I display unique words contained in a Bash string?
body: <p>I have a string that has duplicate words. I would like to display only the unique words. The string is:</p>
  
  <pre><code>variable="alpha bravo charlie alpha delta echo charlie"
  </code></pre>
  
  <p>I know several tools that can do this together. This is what I figured out:</p>
  
  <pre><code>echo $variable | tr " " "\n" | sort -u | tr "\n" " "
  </code></pre>
  
  <p>What is a more effective way to do this?</p>