How does xargs know when a stdin input ends, so that it can start processing it?
up vote
3
down vote
favorite
After reading Stephen Kitt's reply, xargs waits for receiving the stdin input before processing any of the input, such as splitting it into arguments.
How does xargs know when a stdin input ends, so that it can start processing it?
Is -E
used for specifying the end of a stdin input?
Without it, how does xargs knows when it ends? Is there some timeout?
xargs
New contributor
add a comment |
up vote
3
down vote
favorite
After reading Stephen Kitt's reply, xargs waits for receiving the stdin input before processing any of the input, such as splitting it into arguments.
How does xargs know when a stdin input ends, so that it can start processing it?
Is -E
used for specifying the end of a stdin input?
Without it, how does xargs knows when it ends? Is there some timeout?
xargs
New contributor
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
After reading Stephen Kitt's reply, xargs waits for receiving the stdin input before processing any of the input, such as splitting it into arguments.
How does xargs know when a stdin input ends, so that it can start processing it?
Is -E
used for specifying the end of a stdin input?
Without it, how does xargs knows when it ends? Is there some timeout?
xargs
New contributor
After reading Stephen Kitt's reply, xargs waits for receiving the stdin input before processing any of the input, such as splitting it into arguments.
How does xargs know when a stdin input ends, so that it can start processing it?
Is -E
used for specifying the end of a stdin input?
Without it, how does xargs knows when it ends? Is there some timeout?
xargs
xargs
New contributor
New contributor
New contributor
asked 2 hours ago
Ben
2538
2538
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
In the absence of an -E
option, which specifies an explicit end-of-file marker, xargs
knows it’s exhausted its standard input (or any input specified by the -a
option) when read()
returns 0.
You can see this in action by running
printf '%s ' {1..1024} | strace -e read xargs -s 2048 -x
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
In the absence of an -E
option, which specifies an explicit end-of-file marker, xargs
knows it’s exhausted its standard input (or any input specified by the -a
option) when read()
returns 0.
You can see this in action by running
printf '%s ' {1..1024} | strace -e read xargs -s 2048 -x
add a comment |
up vote
6
down vote
In the absence of an -E
option, which specifies an explicit end-of-file marker, xargs
knows it’s exhausted its standard input (or any input specified by the -a
option) when read()
returns 0.
You can see this in action by running
printf '%s ' {1..1024} | strace -e read xargs -s 2048 -x
add a comment |
up vote
6
down vote
up vote
6
down vote
In the absence of an -E
option, which specifies an explicit end-of-file marker, xargs
knows it’s exhausted its standard input (or any input specified by the -a
option) when read()
returns 0.
You can see this in action by running
printf '%s ' {1..1024} | strace -e read xargs -s 2048 -x
In the absence of an -E
option, which specifies an explicit end-of-file marker, xargs
knows it’s exhausted its standard input (or any input specified by the -a
option) when read()
returns 0.
You can see this in action by running
printf '%s ' {1..1024} | strace -e read xargs -s 2048 -x
edited 1 hour ago
answered 1 hour ago
Stephen Kitt
157k23343419
157k23343419
add a comment |
add a comment |
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483939%2fhow-does-xargs-know-when-a-stdin-input-ends-so-that-it-can-start-processing-it%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown