#!/bin/bash
log_file='result.log'
param_file=$1 # 源数据在命令行中指定
log_cmd="tee -a $log_file"
i=1
for line in `cat $param_file`;
do
echo "read line" $i ":" $line | tee -a $log_file
let "i=$i+1"
OLD_IFS=$IFS;IFS=",";
IFS=$OLD_IFS;
curl_cmd="curl -X POST http://url -H \"Authorization: cookie\" -d \"{ \\\"flag\\\": \\\"${line}\\\" }\""
echo `date "+%Y-%m-%d %H:%M:%S"` "start ===>> " $curl_cmd | tee -a $log_file
eval "$curl_cmd 2>&1" | tee -a $log_file
echo `date "+%Y-%m-%d %H:%M:%S"` "end <<===" $curl_cmd | tee -a $log_file
done
echo `date "+%Y-%m-%d %H:%M:%S"` "over: end of shell" | tee -a $log_file
shell2flag
最新推荐文章于 2023-01-13 17:33:10 发布