title: Using bash history to get a previous command, copy it and then 'run' it but with the command commented
body: <p>Just a question to improve my <code>bash</code> skills.  I always do this:</p>
  
  <pre><code>$ history | grep some_long_command
  
  ...
  ...
  123 some_long_command1.........
  124 some_long_command2.........
  ...
  </code></pre>
  
  <p>I can then run the command the command I found by doing:</p>
  
  <p><code>!123</code></p>
  
  <p>However, I often want to do this:</p>
  
  <pre><code>some_long_command1foobar
  </code></pre>
  
  <p>I.e. change the command before I run it.  Can you use bash to run this command instead:</p>
  
  <p><code>#some_long_command1</code></p>
  
  <p>so it gets commented.</p>
  
  <p>Then I don't have to use my mouse to highlight the command, edit it and then run it (I can just use the keyboard - faster).</p>
  
  <p>I suppose I could write a script to do it but there might already be functionality built in somewhere....?</p>