SHELL脚本中按任意键继续与等待时间后继续

  1. #!/bin/bash  
  2.   
  3. function pause(){  
  4.         read -n 1 -p "$*" INP  
  5.         if [[ $INP != '' ]] ; then  
  6.                 echo -ne '\b \n'  
  7.         fi  
  8. }  
  9.   
  10. pause 'Press any key to exit...'  

 

sleep 10  

 

 

你可能感兴趣的:(shell,脚本)