math.ksh

来自「Solaris环境下Shell编程编程」· KSH 代码 · 共 23 行

KSH
23
字号
#!/bin/ksh# Script name: math.ksh# This script finds the cube of a number, and the# quotient and remainder of the number divided by 4.y=99(( cube = y * y * y ))(( quotient = y / 4 ))(( rmdr = y % 4 ))print "The cube of $y is $cube."print "The quotient of $y divided by 4 is $quotient."print "The remainder of $y divided by 4 is $rmdr."# Notice the use of parenthesis to # control the order of evalutaion.(( z = 2 * (quotient * 4 + rmdr) ))print "Two times $y is $z."

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?