Split a long line in a script to a new line

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











up vote
0
down vote

favorite












I have been writing Unix Shell scripts, but I am inexperienced in proper formatting. There were many instances where I had to write long lines to be executed as a single command.



Question is: is there a way that I can split a single long line of Unix command into multiple lines, yet make it execute as a single command?



Thanks.
Kumarjit









share







New contributor




Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I have been writing Unix Shell scripts, but I am inexperienced in proper formatting. There were many instances where I had to write long lines to be executed as a single command.



    Question is: is there a way that I can split a single long line of Unix command into multiple lines, yet make it execute as a single command?



    Thanks.
    Kumarjit









    share







    New contributor




    Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have been writing Unix Shell scripts, but I am inexperienced in proper formatting. There were many instances where I had to write long lines to be executed as a single command.



      Question is: is there a way that I can split a single long line of Unix command into multiple lines, yet make it execute as a single command?



      Thanks.
      Kumarjit









      share







      New contributor




      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have been writing Unix Shell scripts, but I am inexperienced in proper formatting. There were many instances where I had to write long lines to be executed as a single command.



      Question is: is there a way that I can split a single long line of Unix command into multiple lines, yet make it execute as a single command?



      Thanks.
      Kumarjit







      shell-script





      share







      New contributor




      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 8 mins ago









      Kumarjit Ghosh

      1




      1




      New contributor




      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Kumarjit Ghosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Either break apart the long string into smaller, and maybe more readable, components or use a trailing "" to denote a break in the line.



          from 'man bash':




          If a pair appears, and the backslash is not itself
          quoted, the is treated as a line continuation (that is, it
          is removed from the input stream and effectively ignored).






          share




















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



            );






            Kumarjit Ghosh is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477160%2fsplit-a-long-line-in-a-script-to-a-new-line%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
            0
            down vote













            Either break apart the long string into smaller, and maybe more readable, components or use a trailing "" to denote a break in the line.



            from 'man bash':




            If a pair appears, and the backslash is not itself
            quoted, the is treated as a line continuation (that is, it
            is removed from the input stream and effectively ignored).






            share
























              up vote
              0
              down vote













              Either break apart the long string into smaller, and maybe more readable, components or use a trailing "" to denote a break in the line.



              from 'man bash':




              If a pair appears, and the backslash is not itself
              quoted, the is treated as a line continuation (that is, it
              is removed from the input stream and effectively ignored).






              share






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Either break apart the long string into smaller, and maybe more readable, components or use a trailing "" to denote a break in the line.



                from 'man bash':




                If a pair appears, and the backslash is not itself
                quoted, the is treated as a line continuation (that is, it
                is removed from the input stream and effectively ignored).






                share












                Either break apart the long string into smaller, and maybe more readable, components or use a trailing "" to denote a break in the line.



                from 'man bash':




                If a pair appears, and the backslash is not itself
                quoted, the is treated as a line continuation (that is, it
                is removed from the input stream and effectively ignored).







                share











                share


                share










                answered 1 min ago









                kevlinux

                1091




                1091




















                    Kumarjit Ghosh is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    Kumarjit Ghosh is a new contributor. Be nice, and check out our Code of Conduct.












                    Kumarjit Ghosh is a new contributor. Be nice, and check out our Code of Conduct.











                    Kumarjit Ghosh is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477160%2fsplit-a-long-line-in-a-script-to-a-new-line%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?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?