linux之shell:数值运算:简单加减乘除

来源:互联网 发布:浙江航天恒嘉数据科技 编辑:程序博客网 时间:2024/06/14 00:35
sh04.sh


#!/bin/bash
#program
#  user inputs 2 integer numbers;program will cross these two numbers.
#History:
#2014/01/06 yusiyu First release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo -e "you should input 2 numbers,i will cross them!\n "
read -p "first number: " firstnu
read -p "second number: " secnu
total=$(( $firstnu * $secnu ))
echo -e "\nthe result of $firstnu x $secnu is ==> $total"
0 0
原创粉丝点击