linux多个sh 同时执行命令,sh, 批量执行Linux命令

step 1:创建一个sh批处理命令文件

# vim /etc/batch_ssh/install_redis.sh

step 2:给当前用户,能够执行sh脚本权限

# chmod install_redis.sh 777

step 3: 编写要批量执行的命令,read表示等待前端用户输入,sleep表示等待时间单位为 秒。

echo '\n begin to install 01 plugin \n';

yum install cpp -y;

echo '\n yum finish install 01 plugin \n';

sleep 3;

echo '\n begin to install 02 plugin \n';

yum install binutils -y;

echo '\n yum finish install 02 plugin \n';

sleep 3;

echo '\n begin to install 03 plugin \n';

yum install glibc-kernheaders -y;

echo '\n yum finish install 03 plugin \n';

sleep 3;

echo '\n begin to install 04 plugin \n';

yum install glibc-common -y;

echo '\n yum finish install 04 plugin \n';

sleep 3;

echo '\n begin to install 05 plugin

你可能感兴趣的:(linux多个sh,同时执行命令)