shell add & test & echo
来源:互联网 发布:java循环方法的区别 编辑:程序博客网 时间:2024/06/11 04:22
====================================================================================
# Shell Program to Add Two Numbers
clear
echo "Enter first number: "
read a
echo "Enter second number: "
read b
c=`expr $a + $b`
echo "Sum = $c"
====================================================================================
Shell test
Syntax: test prerequisite && statement1 || statement2
Note: if prerequisite is true, then execute statement1, otherwise execute statement2
====================================================================================
[shengshu@cdling21 ~]$ echo -n "aaa"
aaa[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo "aaa"
aaa
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo "aaa\n"
aaa\n
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo -e "aaa\n"
aaa
[shengshu@cdling21 ~]$
====================================================================================
# Shell Program to Add Two Numbers
clear
echo "Enter first number: "
read a
echo "Enter second number: "
read b
c=`expr $a + $b`
echo "Sum = $c"
====================================================================================
Shell test
Syntax: test prerequisite && statement1 || statement2
Note: if prerequisite is true, then execute statement1, otherwise execute statement2
====================================================================================
[shengshu@cdling21 ~]$ echo -n "aaa"
aaa[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo "aaa"
aaa
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo "aaa\n"
aaa\n
[shengshu@cdling21 ~]$
[shengshu@cdling21 ~]$ echo -e "aaa\n"
aaa
[shengshu@cdling21 ~]$
====================================================================================
- shell add & test & echo
- Shell:基本运算符、echo、printf、test
- Shell入门(三)echo.printf.test命令
- Shell 函数 和 Shell echo命令 和 test命令
- echo test
- shell echo
- shell-echo
- TCP echo test
- shell echo 颜色
- shell: 命令echo、cat
- shell echo 参数
- shell之echo命令
- SHELL : echo字体控制
- shell echo换行
- 十三、Shell echo命令
- shell printf(echo增强)
- shell echo命令介绍
- Shell echo命令
- Windows7安装笔记
- KOBJECT类型
- IIC时序详解
- 深入理解Flash的沙箱 – Security Domains
- java集合类比较
- shell add & test & echo
- 网络协议栈(10)netfilter
- Spring中常用的hql查询方法(getHibernateTemplate())
- 动态设置是否锁屏等
- shell input parameter
- sms class
- Java日期格式化及其使用例子收集
- Observer - 观察者模式
- VMware Network Adapter VMnet1和VMnet8 未识别的网络的解决方法