Linux shell之read 用法

2014-11-24 01:45:48 · 作者: · 浏览: 2

Linux shell之read 用法


#!/bin/bash
#read 用来读取屏幕输入或是读取文件内容。
read -p "please input you name: " name #获取输入变量
read -p "please input you age: " age #获取输入变量
echo "you name is $firstname ,age is $age" #输出变量内容


#执行结果
[root@sql tmp]# ./read
please input you name: liyang
please input you age: 100
you name is liyang,age is 100



read a


(续表)


相关阅读