bash in-line brace expansion

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
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
bash readline brace-expansion
add a comment |Â
up vote
2
down vote
favorite
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
bash readline brace-expansion
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
bash readline brace-expansion
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
bash readline brace-expansion
bash readline brace-expansion
edited Sep 15 at 23:25
Goro
5,30552459
5,30552459
asked Sep 11 at 0:04
elig
1468
1468
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
$ $(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.
Under what circumstances is this supposed to work? I can't reproduce it withbashin Emacs command line editing mode in atmuxsession, for example, or on macOS.
â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash forshell-expand-line (M-C-e)@Kusalananda
â Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the defaultbashon macOS is too old and the most recentbashon OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.
â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See whatbind -p | grep shell-expand-linegives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us yourbash --version
â elig
Sep 23 at 4:27
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
$ $(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.
Under what circumstances is this supposed to work? I can't reproduce it withbashin Emacs command line editing mode in atmuxsession, for example, or on macOS.
â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash forshell-expand-line (M-C-e)@Kusalananda
â Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the defaultbashon macOS is too old and the most recentbashon OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.
â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See whatbind -p | grep shell-expand-linegives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us yourbash --version
â elig
Sep 23 at 4:27
add a comment |Â
up vote
4
down vote
$ $(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.
Under what circumstances is this supposed to work? I can't reproduce it withbashin Emacs command line editing mode in atmuxsession, for example, or on macOS.
â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash forshell-expand-line (M-C-e)@Kusalananda
â Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the defaultbashon macOS is too old and the most recentbashon OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.
â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See whatbind -p | grep shell-expand-linegives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us yourbash --version
â elig
Sep 23 at 4:27
add a comment |Â
up vote
4
down vote
up vote
4
down vote
$ $(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.
$ $(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.
edited Sep 15 at 23:04
answered Sep 11 at 0:04
elig
1468
1468
Under what circumstances is this supposed to work? I can't reproduce it withbashin Emacs command line editing mode in atmuxsession, for example, or on macOS.
â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash forshell-expand-line (M-C-e)@Kusalananda
â Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the defaultbashon macOS is too old and the most recentbashon OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.
â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See whatbind -p | grep shell-expand-linegives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us yourbash --version
â elig
Sep 23 at 4:27
add a comment |Â
Under what circumstances is this supposed to work? I can't reproduce it withbashin Emacs command line editing mode in atmuxsession, for example, or on macOS.
â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash forshell-expand-line (M-C-e)@Kusalananda
â Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the defaultbashon macOS is too old and the most recentbashon OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.
â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See whatbind -p | grep shell-expand-linegives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us yourbash --version
â elig
Sep 23 at 4:27
Under what circumstances is this supposed to work? I can't reproduce it with
bash in Emacs command line editing mode in a tmux session, for example, or on macOS.â Kusalananda
Sep 11 at 7:01
Under what circumstances is this supposed to work? I can't reproduce it with
bash in Emacs command line editing mode in a tmux session, for example, or on macOS.â Kusalananda
Sep 11 at 7:01
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash for
shell-expand-line (M-C-e) @Kusalanandaâ Isaac
Sep 11 at 11:55
Make sure that you have the ``` ` ` ``` (or $(...)). Search in man bash for
shell-expand-line (M-C-e) @Kusalanandaâ Isaac
Sep 11 at 11:55
@Isaac Oh well, maybe the default
bash on macOS is too old and the most recent bash on OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.â Kusalananda
Sep 11 at 12:05
@Isaac Oh well, maybe the default
bash on macOS is too old and the most recent bash on OpenBSD is wrongly configured or something, or something else (in the desktop environment) is highjacking the keystrokes. Because it ain't working. That's why I was interested in the circumstances under which this is supposed to work.â Kusalananda
Sep 11 at 12:05
@Kusalananda For the keybinding : See what
bind -p | grep shell-expand-line gives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us your bash --versionâ elig
Sep 23 at 4:27
@Kusalananda For the keybinding : See what
bind -p | grep shell-expand-line gives you. For the brace expansion: did you try doing it with two grave accent characters instead of a dollar-and-parentheses? the latter is a recent update to bash, an enter should expand it too. Tell us your bash --versionâ elig
Sep 23 at 4:27
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468135%2fbash-in-line-brace-expansion%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password