#!/bin/bash stty -echo while

sql 代码
 
  1. #!/bin/bash  
  2.   
  3. # none 1,2,3,15,20 signal  
  4. trap '' 1 2 3 15 20  
  5.   
  6. #clear screen ,close redisplay  
  7. clear  
  8. stty -echo  
  9.   
  10. #set password  
  11. echo -n "Enter your codeword: "  
  12. read secretcode  
  13. echo  
  14.   
  15. #confirm password  
  16. echo -n "Enter your codeword again: "  
  17. read same  
  18. echo  
  19. if [ $secretcode != $same ]  
  20.     then  
  21.         echo "Work on your short-term memory before using this code! "  
  22.         stty echo  
  23.         exit 1  
  24. fi  
  25.   
  26. #get user input  
  27. clear  
  28. echo -n "Enter the code word: "  
  29. read yourguess  
  30. echo  
  31.   
  32.   
  33. #only input is right codeword ,or loop forever  
  34. while [ "$secretcode" != "$yourguess" ]  
  35. do  
  36.     clear  
  37.     echo "secretcode: $secretcode \n yourguess: $yourguess"  
  38.     echo -n "Enter the code word: "  
  39.     read yourguess  
  40. done  
  41.   
  42. #input real password to continue  
  43. clear  
  44. echo "Back gain! "  
  45. stty echo  
  46. exit 0  
sql 代码
  1. #shell   
  2. #! /bin/bash  
  3. files=(`ls`) numfiles=`ls | wc -w`  
  4.   
  5. echo ${files[*]}  
  6. echo ${files[1]}  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值