我需要生成数字值并在 curl 上使用该值。我已经这样做了,但是代码有一些错误,因为无法生成数字。
#!/bin/bash
for a in $(seq 0 9)
do
pass[0]="$a"
for b in $(seq 0 9)
do
pass[1]="$b"
for c in $(seq 0 9)
do
pass[2]="$c"
for d in $(seq 0 9)
do
pass[3]="$d"
for e in $(seq 0 9)
do
pass[4]="$e"
for f in $(seq 0 9)
do
pass[5]="$f"
curl -d "$a$b$c$d$e$f" somesite.php
done
done
done
done
done
done
我得到这个输出:
echo ${pass[*}
> done
>
Display all 289 possibilities? (y or n)
> e
> done
> done
> done
> done
> ^C