Bash에서 컬 프로세스를 병렬로 실행

Bash에서 컬 프로세스를 병렬로 실행

당시 터미널에서 컬 명령을 통해 데이터를 게시하고 싶었지만 좋은 결과를 얻기까지 수천 번이나 걸렸습니다. 다음 bash 코드를 작성했습니다.

  contents=$(< /Users/Andrea/Desktop/data.txt)
  eval "words=( $contents )”
  arguments=()
  for i in {1..10000}
  do
  arguments+=( "${words[@]}" );
  done;
  curl "${arguments[@]}”;

내 JSON 데이터는 data.txt에 저장됩니다. 코드를 실행할 때 모든 요청을 서버에 게시하는 데 시간이 오래 걸리고 전환이 잘 되지 않습니다. 반면에 그 시간 이후에는 많은 요청이 서버에 게시되어 아무 소용이 없습니다. data.txt에는 다음 데이터가 포함되어 있습니다.

 --next 
 'https://d.server.com/easy/api/Order' 
 -H 'Connection: keep-alive' 
 -H 'Pragma: no-cache' 
 -H 'Cache-Control: no-cache' 
 -H 'Accept: application/json, text/plain, */*' 
 -H 'Sec-Fetch-Dest: empty'  
 -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like 
 Gecko) Chrome/80.0.3987.132 Safari/537.36' 
 -H 'Content-Type: application/json' 
 -H 'Origin: https://d.server.com' 
 -H 'Sec-Fetch-Site: same-site' 
 -H 'Sec-Fetch-Mode: cors' 
 -H 'Referer: https://d.server.com/' 
 -H 'Accept- Language: en-US,en;q=0.9,fa;q=0.8' 
 --data-binary '{"name":"Andrea","Id":13647,"family":Bianda,"pr":5400}' 
 -- compressed"

이제 나는 이러한 컬의 릴리스 속도를 높이고 시간이 시작되기 1초 전에 가능한 한 많은 컬을 릴리스할 수 있는 방법을 알고 싶습니다. 이 컬의 응답은 중요하지 않습니다. 성공할 경우 다른 요청은 실패하고 내 차례입니다.

관련 정보