What does “Trailing blanks cause an input line to be logically continued on the next input line” mean?

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











up vote
5
down vote

favorite












From the manual of xargs:




-L max-lines 


Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically
continued on the next input line.
Implies -x.




What does "Trailing blanks cause an input line to be logically continued on the next input line" mean? Can you show it by some examples? Thanks.



Originated from https://unix.stackexchange.com/a/448294/674







share|improve this question























    up vote
    5
    down vote

    favorite












    From the manual of xargs:




    -L max-lines 


    Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically
    continued on the next input line.
    Implies -x.




    What does "Trailing blanks cause an input line to be logically continued on the next input line" mean? Can you show it by some examples? Thanks.



    Originated from https://unix.stackexchange.com/a/448294/674







    share|improve this question





















      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      From the manual of xargs:




      -L max-lines 


      Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically
      continued on the next input line.
      Implies -x.




      What does "Trailing blanks cause an input line to be logically continued on the next input line" mean? Can you show it by some examples? Thanks.



      Originated from https://unix.stackexchange.com/a/448294/674







      share|improve this question











      From the manual of xargs:




      -L max-lines 


      Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically
      continued on the next input line.
      Implies -x.




      What does "Trailing blanks cause an input line to be logically continued on the next input line" mean? Can you show it by some examples? Thanks.



      Originated from https://unix.stackexchange.com/a/448294/674









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 7 at 5:07









      Tim

      22.5k61222401




      22.5k61222401




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          10
          down vote



          accepted










          What the manual is saying is that, trailing spaces at the end of a line of input will cause xargs to treat it as though it were part of the following line - effectively escaping the newline. Consider the following command execution:



          user@host~:$ (echo "line1"; echo "line2") | xargs -L 1 echo
          line1
          line2


          Because of the -L 1 option, each line of input is processed separately, so we get two lines of output. Now compare this with the following example, where the first line of input contains a trailing space:



          user@host~:$ (echo "line1 "; echo "line2") | xargs -L 1 echo
          line1 line2


          Notice that the two lines are treated as a single line of input by xargs.




          It's also worth noting (per the comments) that the -L max-lines option is an XSI extension (cf. the xargs man page on the Open Group website). This is also referred to as an X/Open System Interfaces Extension - a supplementary specification to the Single UNIX Specification (SUS).



          For more information regarding the differences between POSIX, SUS, and XSI, see the following post:



          • Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

          Or consult the section on conformance from the Base Definitions Volume of the Open Group Base Specifications.






          share|improve this answer



















          • 1




            Note that this feature in xargs is a XSI extension.
            – schily
            Jun 7 at 9:05










          • @schily Thanks for the comment. I updated my post.
            – igal
            Jun 7 at 12:25










          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%2f448333%2fwhat-does-trailing-blanks-cause-an-input-line-to-be-logically-continued-on-the%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
          10
          down vote



          accepted










          What the manual is saying is that, trailing spaces at the end of a line of input will cause xargs to treat it as though it were part of the following line - effectively escaping the newline. Consider the following command execution:



          user@host~:$ (echo "line1"; echo "line2") | xargs -L 1 echo
          line1
          line2


          Because of the -L 1 option, each line of input is processed separately, so we get two lines of output. Now compare this with the following example, where the first line of input contains a trailing space:



          user@host~:$ (echo "line1 "; echo "line2") | xargs -L 1 echo
          line1 line2


          Notice that the two lines are treated as a single line of input by xargs.




          It's also worth noting (per the comments) that the -L max-lines option is an XSI extension (cf. the xargs man page on the Open Group website). This is also referred to as an X/Open System Interfaces Extension - a supplementary specification to the Single UNIX Specification (SUS).



          For more information regarding the differences between POSIX, SUS, and XSI, see the following post:



          • Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

          Or consult the section on conformance from the Base Definitions Volume of the Open Group Base Specifications.






          share|improve this answer



















          • 1




            Note that this feature in xargs is a XSI extension.
            – schily
            Jun 7 at 9:05










          • @schily Thanks for the comment. I updated my post.
            – igal
            Jun 7 at 12:25














          up vote
          10
          down vote



          accepted










          What the manual is saying is that, trailing spaces at the end of a line of input will cause xargs to treat it as though it were part of the following line - effectively escaping the newline. Consider the following command execution:



          user@host~:$ (echo "line1"; echo "line2") | xargs -L 1 echo
          line1
          line2


          Because of the -L 1 option, each line of input is processed separately, so we get two lines of output. Now compare this with the following example, where the first line of input contains a trailing space:



          user@host~:$ (echo "line1 "; echo "line2") | xargs -L 1 echo
          line1 line2


          Notice that the two lines are treated as a single line of input by xargs.




          It's also worth noting (per the comments) that the -L max-lines option is an XSI extension (cf. the xargs man page on the Open Group website). This is also referred to as an X/Open System Interfaces Extension - a supplementary specification to the Single UNIX Specification (SUS).



          For more information regarding the differences between POSIX, SUS, and XSI, see the following post:



          • Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

          Or consult the section on conformance from the Base Definitions Volume of the Open Group Base Specifications.






          share|improve this answer



















          • 1




            Note that this feature in xargs is a XSI extension.
            – schily
            Jun 7 at 9:05










          • @schily Thanks for the comment. I updated my post.
            – igal
            Jun 7 at 12:25












          up vote
          10
          down vote



          accepted







          up vote
          10
          down vote



          accepted






          What the manual is saying is that, trailing spaces at the end of a line of input will cause xargs to treat it as though it were part of the following line - effectively escaping the newline. Consider the following command execution:



          user@host~:$ (echo "line1"; echo "line2") | xargs -L 1 echo
          line1
          line2


          Because of the -L 1 option, each line of input is processed separately, so we get two lines of output. Now compare this with the following example, where the first line of input contains a trailing space:



          user@host~:$ (echo "line1 "; echo "line2") | xargs -L 1 echo
          line1 line2


          Notice that the two lines are treated as a single line of input by xargs.




          It's also worth noting (per the comments) that the -L max-lines option is an XSI extension (cf. the xargs man page on the Open Group website). This is also referred to as an X/Open System Interfaces Extension - a supplementary specification to the Single UNIX Specification (SUS).



          For more information regarding the differences between POSIX, SUS, and XSI, see the following post:



          • Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

          Or consult the section on conformance from the Base Definitions Volume of the Open Group Base Specifications.






          share|improve this answer















          What the manual is saying is that, trailing spaces at the end of a line of input will cause xargs to treat it as though it were part of the following line - effectively escaping the newline. Consider the following command execution:



          user@host~:$ (echo "line1"; echo "line2") | xargs -L 1 echo
          line1
          line2


          Because of the -L 1 option, each line of input is processed separately, so we get two lines of output. Now compare this with the following example, where the first line of input contains a trailing space:



          user@host~:$ (echo "line1 "; echo "line2") | xargs -L 1 echo
          line1 line2


          Notice that the two lines are treated as a single line of input by xargs.




          It's also worth noting (per the comments) that the -L max-lines option is an XSI extension (cf. the xargs man page on the Open Group website). This is also referred to as an X/Open System Interfaces Extension - a supplementary specification to the Single UNIX Specification (SUS).



          For more information regarding the differences between POSIX, SUS, and XSI, see the following post:



          • Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

          Or consult the section on conformance from the Base Definitions Volume of the Open Group Base Specifications.







          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jun 7 at 12:04


























          answered Jun 7 at 5:19









          igal

          4,785930




          4,785930







          • 1




            Note that this feature in xargs is a XSI extension.
            – schily
            Jun 7 at 9:05










          • @schily Thanks for the comment. I updated my post.
            – igal
            Jun 7 at 12:25












          • 1




            Note that this feature in xargs is a XSI extension.
            – schily
            Jun 7 at 9:05










          • @schily Thanks for the comment. I updated my post.
            – igal
            Jun 7 at 12:25







          1




          1




          Note that this feature in xargs is a XSI extension.
          – schily
          Jun 7 at 9:05




          Note that this feature in xargs is a XSI extension.
          – schily
          Jun 7 at 9:05












          @schily Thanks for the comment. I updated my post.
          – igal
          Jun 7 at 12:25




          @schily Thanks for the comment. I updated my post.
          – igal
          Jun 7 at 12:25












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448333%2fwhat-does-trailing-blanks-cause-an-input-line-to-be-logically-continued-on-the%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?