Use the last command\’s output as input to a command without piping and bind to it to a key sequence in bash.

2010-09-01 181 words 1 min read

Use the last command’s output as input to a command without piping and
bind to it to a key sequence in <a class="zem_slink" title="Bash (Unix shell)" rel="homepage" href="http://tiswww.case.edu/php/chet/bash/bashtop.html">bash.

  <td>
    <div class="bash codecolorer">
      &nbsp;<span class="kw3">bind</span> <span class="co3">\'</span><span class="st0">"\\C-h"</span>: <span class="st0">"\\<span class="es5">`fc\\ \\-s\\`</span>"</span><span class="co3">\'</span>
    </div>
  </td>
</tr>
1

My comment : fc is the fix command of the bash builtin.
This is similar to using `!!` or

In bash 4.1 it seems you can bind directly to a shell command, but I&#8217;m
not running that version.

  • View this command to comment, vote or add to favourites
  • View all commands by rthemocap

commandlinefu.com

by David Winterbottom (codeinthehole.com)

<a class="zem_slink" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL:
<a href="http://feedproxy.google.com/~r/Command-line-fu/~3/Y59sGmIg24s/use-the-last-commands-output-as-input-to-a-command-without-piping-and-bind-to-it-to-a-key-sequence-in-bash.">http://feedproxy.google.com/~r/Command-line-fu/~3/Y59sGmIg24s/use-the-last-commands-output-as-input-to-a-command-without-piping-and-bind-to-it-to-a-key-sequence-in-bash.<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.commandlinefu.com/commands/view/5034/google-translate">Google Translate | commandlinefu.com (commandlinefu.com) <li class="zemanta-article-ul-li"><a href="http://www.nofluffjuststuff.com/blog/matthew_mccullough/2010/08/git_bash_prompt">Git Bash Prompt (nofluffjuststuff.com) <li class="zemanta-article-ul-li"><a href="http://www.innovationsts.com/blog/?p=1395">Writing Better Shell Scripts – Part 1 | Innovations Technology Solutions | Blog (innovationsts.com) <li class="zemanta-article-ul-li"><a href="http://blog.extracheese.org/2010/05/the-tar-pipe.html">The Tar Pipe (extracheese.org) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=519b6bb2-2552-40a7-a9dc-c70e8d4afe3d" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it