运行shell时,提示declare: not found

需要面对面帮助?请寻求当地校园社团支持!
回复
washion
帖子: 11
注册时间: 2009-10-29 14:13
联系:

运行shell时,提示declare: not found

#1

帖子 washion » 2009-12-01 15:32

请问各位高手们是什么原因阿?
我的程序是:
#!/bin/bash
#This program is used to "declare" variables
#user 2009/11/26
number1=2*3+5*13-32+25
#declare -i
number2=2*3+5*13-32+25
echo "Your result is ==> $number1"
echo "Your resutl is ==> $number2"
输出结果应该是:
Your result is ==> 2*3+5*13-32+25
Your resutl is ==> 64
而我的输出是:
user@user-desktop:~/test$ sh test03-declare.sh
test03-declare.sh: 5: declare: not found
Your result is ==> 2*3+5*13-32+25
Your resutl is ==>
zhang_jh
帖子: 6
注册时间: 2009-11-16 14:39

Re: 运行shell时,提示declare: not found

#2

帖子 zhang_jh » 2010-02-20 16:47

sudo dpkg-reconfigure dash选否
zxc_123
帖子: 3
注册时间: 2010-04-18 10:59

Re: 运行shell时,提示declare: not found

#3

帖子 zxc_123 » 2010-05-14 21:59

3楼正解。
头像
见特但
帖子: 105
注册时间: 2009-10-11 14:43

Re: 运行shell时,提示declare: not found

#4

帖子 见特但 » 2010-11-24 14:00

sudo dpkg-reconfigure dash不管用呦
貌似不能的…… :em06
elon0211
帖子: 1
注册时间: 2011-03-02 19:58

Re: 运行shell时,提示declare: not found

#5

帖子 elon0211 » 2011-03-02 20:02

谢谢3楼!~我的也可以了!~哈哈哈!~楼主也是在看鸟哥把!~这个是鸟哥的例题
0biyao0
帖子: 1
注册时间: 2011-03-30 16:00

Re: 运行shell时,提示declare: not found

#6

帖子 0biyao0 » 2011-03-30 16:08

感谢3楼,我也在看鸟哥
回复