Sunnnner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash
# learn about how to read from user input

echo "Places input your name"

read name

echo "your had input name is $name"
# -p 是promote ,提示的意思就是可以让用户在提示语相同
# 一行输入内容
read -p "Please input a name" user_var
echo "your had input name is: $user_var"

# 模拟用户输入密码操作
read -p "place input you name" users_var
# -s一般在输入密码的时候启用可以输入过程看不到操作
read -sp "place input you password" pas_var

echo "you had input name is $users_var"
echo "you had input password is $pas_var"

 Comments