What does âTrailing blanks cause an input line to be logically continued on the next input lineâ mean?
Clash 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
xargs
add a comment |Â
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
xargs
add a comment |Â
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
xargs
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
xargs
asked Jun 7 at 5:07
Tim
22.5k61222401
22.5k61222401
add a comment |Â
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
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%2f448333%2fwhat-does-trailing-blanks-cause-an-input-line-to-be-logically-continued-on-the%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