LINUX shell编程2 命令

来源:互联网 发布:ps基线优化 编辑:程序博客网 时间:2024/05/16 08:10

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

0 0
原创粉丝点击