title: Get output from fzf in the terminal without executing it
body: <p>fzf rocks! I want to use it to search bash history. When a match is found, I want it to be placed on the command line, but <strong><em>not</em></strong> executed so I can edit it further. (All of this is in a sourced bash function or script so it has access to my history.)</p>
  
  <p>I have it almost working, but not quite.</p>
  
  <p>This selects the command, but runs it immediately:</p>
  
  <pre><code>eval $(history | "$HOME/bin/fzf" +s | sed 's/ *[0-9]* *//')
  </code></pre>
  
  <p>This gets it into my clipboard, but when I paste it, it still ends with a blank and a newline so it executes immediately.</p>
  
  <pre><code>history | "$HOME/bin/fzf" +s | sed 's/ *[0-9]* *//' | xclip -se c
  </code></pre>
  
  <p>I also tried a couple of variations including</p>
  
  <pre><code>history | "$HOME/bin/fzf" +s | sed -e 's/ *[0-9]* *//' -e 's/$//' | xclip -se c
  </code></pre>
  
  <p>with the same result.</p>
  
  <p>This actually works, but I still have to put it in the clipboard and then manually paste it.</p>
  
  <pre><code>history | "$HOME/bin/fzf" +s | sed -re 's/ *[0-9]* *//' | awk '{printf "%s", $0}' | xclip -se c
  </code></pre>
  
  <p>How can I do this in one step - without a manual paste?</p>
  
  <p>I thought just leaving off the xclip would do it, but it doesn't work.</p>