
curl
parms 값을 기반으로 작업을 수행하는 명령을 작업 중입니다.
curl 'http://www.example.com/actionid?id=123'
id
동적으로 값을 펌핑하고 싶습니다.
seq 1 10 | xargs -I + curl 'http://example.com/actionid?id=123'
내가 얻는 출력에서
curl 'http://example.com/actionid?id=+'
curl 'http://example.com/actionid?id=+'
curl 'http://example.com/actionid?id=+'
....
내가 시도한 값으로 어떻게 전달할 수 있습니까?
seq 1 10 | xargs -I + curl 'http://example.com/actionid?id=123'`< <(printf '+\n' $(seq 1 10)
나는 같은 결과를 얻습니다.
해결책
그것을 주위에 두십시오 '
- '~'
나는 지금 작동하고 있습니다.
답변1
printf '%d\n' {1..10} | xargs -i -- echo curl http://example.com/actionid?id={}
시간을 삭제 echo
하고 실제 URL을 입력하세요.
답변2
루프를 사용하십시오.
for i in $(seq 1 10) ; do
curl http://example.com/actionid\?id=$i
done