Step 1: Create an SH batch command file
# vim/etc/batch_ssh/install_redis.sh
Step 2: To the current user, be able to execute SH script permissions
# chmod install_redis.sh 777
Step 3: Write the command to be executed in bulk, read to wait for the front-end user input, and sleep to indicate the wait time in seconds.
echo ' \ n begin to install plugin \ n '; yum install Cpp-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; echo ' \ n begin to install plugin \ n '; yum install Binutils-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; echo ' \ n begin to install plugin \ n '; yum install Glibc-kernheaders-y;echo ' \ n Yum finish install plugin \ n '; Sleep 3 ; echo ' \ n begin to install plugin \ n '; yum install Glibc-common-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; echo ' \ n begin to install plugin \ n '; yum install Glibc-devel-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; echo ' \ n begin to install plugin \ n '; yum install Gcc-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; echo ' \ n begin to install plugin \ n '; yum install Make-y;echo ' \ n Yum finish install plugin \ n '; sleep 3; Echo ' all plugin had installed completed '; read;
Step 4: Finally, remember to save the file
#: Wq install_redis.sh
Step 5: Execute the Batch script file install_redis.sh
#/etc/batch_ssh/install_redis.sh
Or in the current directory, execute the
#./install_redis.sh
When all commands are completed, the following message is shown:
SH, batch execution of Linux commands