curl
단독 으로 사용됨
컬 'https://abc.ai/getMultiDashboard/' -H '사용자 에이전트: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0' -H '수락: 애플리케이션/ json ' -H '언어 허용: en-US, en; q=0.5' --compressed -H '연결: 연결 유지' -H '인용:https://abc.ai/'-H '쿠키:_ga=GA1.2.561275388.1601468723; _hjid=ecd3d778-b7f5-4f7f-b3ef-6f9f12b13d66; _gid=GA1.2.1366208807.1601560229 _h jTLDTest=1; 54651cc_data=JTdCJTIyaWQlMjIlM0ElMjJkZW1vdXNlciUyMiUyQyUyMm4lMjIlM0ElMjJkZWhY2Nlc3NUb2tlbiUyMiUzQSUyMjA2MTk3NjM3NTgwOGE2N2RmZjlhMmJl OWJ 모드5NDQzJ TIyJTdE 54651cc_loggedin= 1; 54651cc_sound=참; 54651cc_popup=참; 54651cc_usertype=로그인 사용자; _hjAbsoluteSessionInProgress=0; 8ZGd7Mol31n_Y8OC Lq39dHoo3_mIlRhZ.pFQWz5gG9McKsQLzOikcTBmmb2Wcrxo%2B9u9iPpqoyxw; pageUrl=/#/ 대시보드/ 18; _gat_gtag_UA_97985973_5=1'
산출
[{"dashboard_id": 18, "user_id": "demouser", "dashboard_name": "My_dashboard_1", "description": "테스트 설명 1", "creation_date": "2020-09-21 10:13:00" , "dashboard_config": 비어 있음 }]
함께 달리다
xargs -I % -P 2 컬 'https://abc.ai/getMultiDashboard/' -H '사용자 에이전트: Mozilla/5.0(Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0' - H '수락: application/json' -H '수락 언어: en-US, en;q=0.5' --compressed -H '연결: 연결 유지' -H '읽은 사람:https://abc.ai/'-H '쿠키:_ga=GA1.2.561275388.1601468723; _hjid=ecd3d778-b7f5-4f7f-b3ef-6f9f12b13d66; _gid=GA1.2.1366208807.1601560229 _h jTLDTest=1; 54651cc_data=JTdCJTIyaWQlMjIlM0ElMjJkZW1vdXNlciUyMiUyQyUyMm4lMjIlM0ElMjJkZWhY2Nlc3NUb2tlbiUyMiUzQSUyMjA2MTk3NjM3NTgwOGE2N2RmZjlhMmJl OWJ 모드5NDQzJ TIyJTdE 54651cc_loggedin= 1; 54651cc_sound=참; 54651cc_popup=참; 54651cc_usertype=로그인 사용자; _hjAbsoluteSessionInProgress=0; 8ZGd7Mol31n_Y8OC Lq39dHoo3_mIlRhZ.pFQWz5gG9McKsQLzOikcTBmmb2Wcrxo%2B9u9iPpqoyxw; pageUrl=/#/ 대시보드/ 18; _gat_gtag_UA_97985973_5=1'
< <(printf '%s\n' {1..2})
산출 루트@루트:~#
기본적으로 xargs를 사용하면 여러 줄 컬 cmd를 구문 분석할 수 없다고 생각합니다. 문제 해결을 도와주세요.
고쳐 쓰다
똑같은 cmd 논리를 사용하면 다른 결과가 나오며 실제로는 HTTP 응답이 출력됩니다.
xargs -I % -P 2 curl -I "https://youtube.com" < <(printf '%s\n' {1..2})
HTTP/2 301
content-length: 0
strict-transport-security: max-age=31536000; includeSubDomains; preload
location: https://www.youtube.com/
date: Fri, 02 Oct 2020 18:04:05 GMT
content-type: text/html
server: YouTube Frontend Proxy
x-xss-protection: 0
alt-svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
HTTP/2 301
content-length: 0
strict-transport-security: max-age=31536000; includeSubDomains; preload
location: https://www.youtube.com/
date: Fri, 02 Oct 2020 18:04:05 GMT
content-type: text/html
server: YouTube Frontend Proxy
x-xss-protection: 0
alt-svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"