#!/bin/bash
 
if read -t 5 -p "please enter your name:" name
 
then
 
    echo "hello $name ,welcome to my script"
 
else
 
    echo "sorry,too slow"
 
fi
 
exit 0

输出

please enter your name:xsxsxs
hello xsxsxs ,welcome to my script

 

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2021-11-30
  • 2022-01-24
  • 2021-08-18
  • 2021-11-04
  • 2021-06-11
猜你喜欢
  • 2021-05-20
  • 2021-11-12
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案