隐藏方式读取数据

5年以前  |  阅读数:495 次  |  编程语言:Shell 
#!/bin/bash
# hiding input data from monitor

read -s -p "Please enter your password: " pass

#添加了-s选项之后,不会自动换行,不添加-s 会自动换行
echo 
echo "Is your password really $pass?"

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8