[root@hadoop3 xiaole_chk_url]# sh looh.es.res.sh
100
200
1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 61740 100 61721 100 19 472k 148 --:--:-- --:--:-- --:--:-- 474k
200
300
2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 90475 100 90456 100 19 752k 161 --:--:-- --:--:-- --:--:-- 755k
[root@hadoop3 xiaole_chk_url]# cat looh.es.res.sh
loop_step=100
loop_stop=3
loop_period_start=0
loop_period_end=0
res_file=res.${BASH_SOURCE}.json.txt
log_file=${BASH_SOURCE}.log
#es_str0='curl 'hadoop3:9200/direct_vote/kwaddress/_search?pretty=true' -d '{"from": '
#es_str1='curl 'hadoop3:9200/direct_vote/kwaddress/_search?pretty=true' -d '{"from": 1,"size": 10}''
es_str=''
for((i=1;i
do
loop_period_start=$((i*loop_step))
loop_period_end=$((loop_period_start+loop_step))
echo $loop_period_start
echo $loop_period_end
echo $i
es_str='curl hadoop3:9200/direct_vote/kwaddress/_search?pretty=true -d "{"from":'${loop_period_start}',"size":'${loop_period_end}}'"'
eval $es_str > $res_file
done
exit 0
[root@hadoop3 xiaole_chk_url]# head res.looh.es.res.sh.json.txt
{
"took" : 115,
"timed_out" : false,
"_shards" : {
"total" : 7,
"successful" : 7,
"failed" : 0
},
"hits" : {
"total" : 29489918,
[root@hadoop3 xiaole_chk_url]# head res.looh.es.res.sh.json.txt
shell 字符串与数字 拼接
执行字符串语句