bash in-line brace expansion

The name of the pictureThe name of the pictureThe name of the pictureClash 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










share|improve this question



























    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










    share|improve this question

























      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










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 15 at 23:25









      Goro

      5,30552459




      5,30552459










      asked Sep 11 at 0:04









      elig

      1468




      1468




















          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.







          share|improve this answer






















          • 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










          • @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











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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.







          share|improve this answer






















          • 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










          • @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















          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.







          share|improve this answer






















          • 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










          • @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













          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.







          share|improve this answer














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








          share|improve this answer














          share|improve this answer



          share|improve this answer








          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 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










          • @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

















          • 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










          • @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
















          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


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay