curl stops working when used in combination with xargs
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I need to check a list of domains in parallel. So I was planning on using curl
and xargs
.
This is check.sh
:
#!/bin/bash
domain=$1?Pass the domain as a parameter
curl -o /dev/null --silent --write-out "http://$domain/,%http_code,%redirect_urln" "http://$domain/"
Now, when used a single time it works:
$ ./check.sh example.com
http://example.com,200,
If instead I use it in combination with xargs
, curl
does not work properly and the output looks broken:
$ cat domains.txt | xargs -L1 -P2 ./check.sh
,000,//example.com
,000,//example.org
This happens also without -P2
, so it must be related to the way lines are passed to the script. I also added an echo "$domain"
in it, but everything looks ok.
curl xargs
add a comment |Â
up vote
0
down vote
favorite
I need to check a list of domains in parallel. So I was planning on using curl
and xargs
.
This is check.sh
:
#!/bin/bash
domain=$1?Pass the domain as a parameter
curl -o /dev/null --silent --write-out "http://$domain/,%http_code,%redirect_urln" "http://$domain/"
Now, when used a single time it works:
$ ./check.sh example.com
http://example.com,200,
If instead I use it in combination with xargs
, curl
does not work properly and the output looks broken:
$ cat domains.txt | xargs -L1 -P2 ./check.sh
,000,//example.com
,000,//example.org
This happens also without -P2
, so it must be related to the way lines are passed to the script. I also added an echo "$domain"
in it, but everything looks ok.
curl xargs
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I need to check a list of domains in parallel. So I was planning on using curl
and xargs
.
This is check.sh
:
#!/bin/bash
domain=$1?Pass the domain as a parameter
curl -o /dev/null --silent --write-out "http://$domain/,%http_code,%redirect_urln" "http://$domain/"
Now, when used a single time it works:
$ ./check.sh example.com
http://example.com,200,
If instead I use it in combination with xargs
, curl
does not work properly and the output looks broken:
$ cat domains.txt | xargs -L1 -P2 ./check.sh
,000,//example.com
,000,//example.org
This happens also without -P2
, so it must be related to the way lines are passed to the script. I also added an echo "$domain"
in it, but everything looks ok.
curl xargs
I need to check a list of domains in parallel. So I was planning on using curl
and xargs
.
This is check.sh
:
#!/bin/bash
domain=$1?Pass the domain as a parameter
curl -o /dev/null --silent --write-out "http://$domain/,%http_code,%redirect_urln" "http://$domain/"
Now, when used a single time it works:
$ ./check.sh example.com
http://example.com,200,
If instead I use it in combination with xargs
, curl
does not work properly and the output looks broken:
$ cat domains.txt | xargs -L1 -P2 ./check.sh
,000,//example.com
,000,//example.org
This happens also without -P2
, so it must be related to the way lines are passed to the script. I also added an echo "$domain"
in it, but everything looks ok.
curl xargs
curl xargs
asked 6 mins ago
rubik
367416
367416
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f479489%2fcurl-stops-working-when-used-in-combination-with-xargs%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