浏览代码

fix bulk.sh script

jomo 10 年之前
父节点
当前提交
fd6fd0f1bd
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      test/bulk.sh

+ 3 - 4
test/bulk.sh

@@ -17,14 +17,13 @@ if [ -z "$host" ] || [ ! -z "$@" ]; then
 fi
 fi
 
 
 # insert newline after uuids
 # insert newline after uuids
-id_file="$(echo | cat 'uuids.txt' - 'usernames.txt')"
+ids="$(echo | cat 'uuids.txt' - 'usernames.txt')"
 # `brew install coreutils` on OS X
 # `brew install coreutils` on OS X
-id_file="$(shuf <<< "$id_file" || gshuf <<< "$id_file")"
-mapfile ids <<< "$id_file"
+ids="$(shuf <<< "$ids" 2>/dev/null || gshuf <<< "$ids")"
 
 
 bulk() {
 bulk() {
   trap return INT
   trap return INT
-  for id in $ids; do
+  echo "$ids" | while read id; do
     if [ -z "$async" ]; then
     if [ -z "$async" ]; then
       curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" -- "$host/avatars/$id?helm"
       curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" -- "$host/avatars/$id?helm"
     else
     else