bash in-line brace expansion

elig

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

elig
$ $(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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

bash in-line brace expansion

From Dev

Brace expansion with numbers in bash

From Dev

BASH brace expansion algorithm

From Dev

Brace expansion with numbers in bash

From Dev

Bash Brace Expansion & Variables

From Dev

Bash Brace Expansion and cp

From Dev

bash - brace expansion not expanding?

From Dev

Nested brace expansion mystery in Bash

From Dev

Bash Brace Expansion in Systemd ExecStart

From Dev

Nested brace expansion mystery in Bash

From Dev

`seq` and bash brace expansion failing

From Dev

How to write fancy-indented multi-line brace expansion in Bash?

From Dev

trying bash brace expansion (discrete numbers) using while read line and echo, doesn't expand

From Dev

Combine brace and variable expansion in one line

From Dev

Change separator/delim in bash brace expansion

From Dev

Brace expansion with step increment not working bash

From Dev

Bash brace expansion after a path slash

From Dev

Bash brace expansion after a path slash

From Dev

bash shellcheck issue with variables in brace expansion

From Dev

Brace expansion with step increment not working bash

From Dev

Can I use a variable in a Bash brace expansion?

From Dev

In bash, is it possible to use an integer variable in a brace expansion

From Dev

Bash brace expansion to remove part of filename

From Dev

Change separator/delim in bash brace expansion

From Dev

Bash brace expansion with variables for pattern matching

From Dev

Can I use bash brace expansion in for loop?

From Dev

Can't combine brace expansion with parameter expansion in bash

From Dev

Brace expansion : run several commands instead of expanding on one line?

From Dev

How does bash differentiate between brace expansion and command grouping?

Related Related

HotTag

Archive