您的位置:首页 > 运维架构 > Shell

LINUX shell编程2 命令

2014-03-17 15:10 316 查看

1 read:从键盘读入数据,赋给变量

cat read

#i/bin/sh

read first second third

echo "the first parameter is $first"

echo "the second parameter is $second"

echo "the third parameter is $third"

# sh -x read 

-x: 显示执行过程

2 expr:对整数型变量的算术运算

expr 3 + 5 (中间有空格)

expr 3 \* 10 (乘法需要有转义符)

复杂运算:expr 'expr 5 + 7' / 7
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux shell