shell script 计算两个整数乘积 取余

来源:互联网 发布:房源采集的中介软件 编辑:程序博客网 时间:2024/06/04 19:15
#!/bin/bash#Program# user input two integer number; program will cross these two number ,and#remainder#History# 2013/08/29  zhangxxxww  First releasePATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATHecho -e "Please according to Tips input  two integer number!"read -p  "fisrt integer number:" firstnumread -p "second integer number:" secnumtotal=$((${firstnum}*${secnum}))nmnum=$((${firstnum}%${secnum}))echo -e "\nThe result of $firstnum *  $secnum is ==> $total"echo -e "\nThe result of $firstnum %  $secnum is ==> $nmnum"

源自鸟哥一书 P378

原创粉丝点击