Bashisms

Russell Power over at rjpower.org has a nice post on some Bash tricks. Despite over 20 years of Bash use I learned something new. It turns out that if you type【Ctrl+x Ctrl+e】Bash will bring up an editor session that allows you to edit the control line. The editor called is specified by FCEDIT if set, then EDITOR, and then defaults to Emacs. This will do the right thing for almost everybody. Almost everyone sets EDITOR and almost no one sets FCEDIT so【Ctrl+x Ctrl+e】 will do the right thing for most people.

This isn’t the type of thing you use everyday but if you have a complicated command line that fails and you want to change it a bit this is a nice way of doing it. All the powers of Emacs on your command line. What’s not to like? And don’t forget the other tips—also useful.

This entry was posted in General and tagged . Bookmark the permalink.

2 Responses to Bashisms

  1. S says:

    The trick is bash-specific. It doesn’t work in zsh.

    • ib says:

      Add the following to your .zshrc:

      autoload -U edit-command-line
      zle -N edit-command-line
      bindkey '\C-x\C-e' edit-command-line

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>