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

10 lines
222 B
Bash
Raw Permalink Normal View History

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