linux-tutorial/codes/shell/示例脚本/输入和输出/隐藏方式读取数据.sh

9 lines
214 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
# hiding input data from monitor
read -s -p "Please enter your password: " pass
#添加了-s选项之后不会自动换行不添加-s 会自动换行
echo
echo "Is your password really $pass?"