Este script es un script de prueba de estrés, generalmente lo usamos cuando probamos Nginx y Apache.
Xiaoyue: Xiaohan, Xiaohan, ¿estás ahí?
Xiaohan: Sí , ¿qué pasa, hierro viejo?
Xiaoyue: Tu script de shell es tan bueno, ¿puedes escribir un script divertido?
Xiao Han: Siempre que puedas, te escribiré cuando tenga tiempo.
: 岳 : razones。
Cuando le envié el guión ...
Xiaohan : Xiaoyue Xiaoyue, ¡te he enviado el guión que quieres!
Xiao Yue: Está bien, buen chico.
Guión al final
Nota: muy interesante
Sube el guión (tira a la parte inferior de la pantalla)
[root@hya shell]# vim bk.sh
#!/bin/bash
urls=`cat url.txt`
for url in $urls
do
ab -n 1 $url > /dev/null
done
echo "成功"
echo "成功" >> /root/url.log
[root@hya shell]# vim url.txt
放链接
[root@hya shell]# touch url.log 存放的是日志