分页: 1 / 1

为什么这两个等价

发表于 : 2008-11-12 13:36
yzq8951
就是
#!/bin/bash
# Program:
# User can input 2 integer to cross by
#History:
#2008/11/12 yzq8951
PATH=/bin:/sbin:/usr/sbin:/usr/local/bin:/use/local/sbin:/~/bin
export PATH
echo -e "You should input 2 numbers ,I will cross they"
read -p "first number:" firstnu
read -p "second number:" secnu
declare -i total=$firstnu*$secnu
echo -e "\nThe number $firstnu * $secnu is ==> $total"

declare -i total=$firstnu*$secnu和total=$(($firstnu*$secnu ))是等价的 我对这个$()不太懂

Re: 为什么这两个等价

发表于 : 2008-11-12 13:39
bones7456
等价就等价了,还为什么? :em05
注意兼容性就好了.

Re: 为什么这两个等价

发表于 : 2008-11-12 14:02
xiooli
(())里面的和c语言语法相同。