#!/bin/bash
# -*- coding: utf-8 -*-
#
echo -n "please input your name: "
read name
echo "hello $name,welcome to my linux!"
exit 0
#下面来看看使用-p选项的效果,与上面等效。
read -p "please input your name: " name
echo "hello $name,welcome to my linux!"
#-p,添加提示符。
#读取输入,但不在屏幕显示
read -s -p "password: " password
echo "" #用来换行
echo "your password is $password."
exit 0
#设置定时器,-t选项
read -t 5 -p "name: " name
echo "your name is $name."
exit 0
及时行乐