Does bash/readline have a binding or a function that a key combination can be binded to in order to expand in-line braces? Similar to the way M-* key
combination can be used for in-line globbing expansion.
So upon performing a key-combination
$ {a..z}
will turn in place into :
$ a b c d e f g h i j k l m n o p q r s t u v w x y z
$ $(echo {a..z})
CTRL + ALT + e
$ a b c d e f g h i j k l m n o p q r s t u v w x y z
Note that it will expand all the expansions on the command line. No matter where the cursor is placed.
With this command (and a=this; b=that
):
$ echo "$a"; $(echo {a..m}); echo "$b"
This will be expanded:
$ echo this; a b c d e f g h i j k l m ; echo that
From man bash
:
shell-expand-line (M-C-e)
Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word expansions. See HISTORY EXPANSION below for a description of history expansion.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments