使用read命令编写一个script,让用户输入用户的信息,最后再屏幕上显示出用户的输入。
1 创建一个新的sh文件
2 vim编辑器打开修改
- #!bin/bash
- #Program
- #2011/11/08
- PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/bin:~/bin
- export PATH
- read -p "Please input your name:" name
- read -p "Please input your password:" password
- echo -e "\nYour name is :$name"
- echo -e "\nYour password is :$password"
阅读(1118) | 评论(0) | 转发(0) |