Neat Bash trick: open last command for editing in default editor, then execute on save

Comments

2 comments posted
From bash man page

From bash man page

edit-and-execute-command (C-xC-e)
Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke
$FCEDIT, $EDITOR, and emacs as the editor, in that order.

Posted by Anonymous (not verified) on Thu, 05/05/2011 - 16:15
Great tip! My .bashrc
Great tip! My .bashrc contains: export EDITOR="bbedit -w --resume" Typing 'fc' opens the command in BBEdit. From there, if you edit/save/close the window, the modified command gets executed back in the original Terminal window.
Posted by Steve Kalkwarf (not verified) on Tue, 03/30/2010 - 09:38

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a biological visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.