linux-tutorial/codes/shell/示例脚本/输入和输出/隐藏方式读取数据.sh
2019-05-10 11:17:57 +08:00

9 lines
214 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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