What does the * in this line do/indicate?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm working on a little script and I found another solution like the one I came up with use this line here:



for i in *; do


What exactly does the *; do/mean here? I'm used to seeing $ variables.







share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm working on a little script and I found another solution like the one I came up with use this line here:



    for i in *; do


    What exactly does the *; do/mean here? I'm used to seeing $ variables.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm working on a little script and I found another solution like the one I came up with use this line here:



      for i in *; do


      What exactly does the *; do/mean here? I'm used to seeing $ variables.







      share|improve this question














      I'm working on a little script and I found another solution like the one I came up with use this line here:



      for i in *; do


      What exactly does the *; do/mean here? I'm used to seeing $ variables.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 15 at 17:23









      Stéphane Chazelas

      281k53518849




      281k53518849










      asked Jan 15 at 16:52









      Saith

      103




      103




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          for i in *; do


          The * here is the filename globbing character that matches all (non-hidden) names in the current directory.



          In each iteration of the loop, the variable i will take the value of each of the names matching * in turn.



          The ; after the * (as in most other places) may be replaced by a newline:



          for i in *
          do





          share|improve this answer


















          • 1




            @Saith then you should accept the answer!
            – Putnik
            Jan 15 at 20:53

















          up vote
          1
          down vote













          Per Confused about the behavior of asterisk in ls command




          Asterisk expands before it gets to the [...your...] command




          So you are passing all the files matching your pattern * to for






          share|improve this answer




















            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%2f417290%2fwhat-does-the-in-this-line-do-indicate%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            for i in *; do


            The * here is the filename globbing character that matches all (non-hidden) names in the current directory.



            In each iteration of the loop, the variable i will take the value of each of the names matching * in turn.



            The ; after the * (as in most other places) may be replaced by a newline:



            for i in *
            do





            share|improve this answer


















            • 1




              @Saith then you should accept the answer!
              – Putnik
              Jan 15 at 20:53














            up vote
            5
            down vote



            accepted










            for i in *; do


            The * here is the filename globbing character that matches all (non-hidden) names in the current directory.



            In each iteration of the loop, the variable i will take the value of each of the names matching * in turn.



            The ; after the * (as in most other places) may be replaced by a newline:



            for i in *
            do





            share|improve this answer


















            • 1




              @Saith then you should accept the answer!
              – Putnik
              Jan 15 at 20:53












            up vote
            5
            down vote



            accepted







            up vote
            5
            down vote



            accepted






            for i in *; do


            The * here is the filename globbing character that matches all (non-hidden) names in the current directory.



            In each iteration of the loop, the variable i will take the value of each of the names matching * in turn.



            The ; after the * (as in most other places) may be replaced by a newline:



            for i in *
            do





            share|improve this answer














            for i in *; do


            The * here is the filename globbing character that matches all (non-hidden) names in the current directory.



            In each iteration of the loop, the variable i will take the value of each of the names matching * in turn.



            The ; after the * (as in most other places) may be replaced by a newline:



            for i in *
            do






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 15 at 17:09

























            answered Jan 15 at 16:58









            Kusalananda

            103k13203321




            103k13203321







            • 1




              @Saith then you should accept the answer!
              – Putnik
              Jan 15 at 20:53












            • 1




              @Saith then you should accept the answer!
              – Putnik
              Jan 15 at 20:53







            1




            1




            @Saith then you should accept the answer!
            – Putnik
            Jan 15 at 20:53




            @Saith then you should accept the answer!
            – Putnik
            Jan 15 at 20:53












            up vote
            1
            down vote













            Per Confused about the behavior of asterisk in ls command




            Asterisk expands before it gets to the [...your...] command




            So you are passing all the files matching your pattern * to for






            share|improve this answer
























              up vote
              1
              down vote













              Per Confused about the behavior of asterisk in ls command




              Asterisk expands before it gets to the [...your...] command




              So you are passing all the files matching your pattern * to for






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                Per Confused about the behavior of asterisk in ls command




                Asterisk expands before it gets to the [...your...] command




                So you are passing all the files matching your pattern * to for






                share|improve this answer












                Per Confused about the behavior of asterisk in ls command




                Asterisk expands before it gets to the [...your...] command




                So you are passing all the files matching your pattern * to for







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 15 at 16:58









                WEBjuju

                410211




                410211






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417290%2fwhat-does-the-in-this-line-do-indicate%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)