Flash初哥

November 28, 2009

let: not found

Filed under: 網上收隼 — Tags: , , , — KAV @ 11:06 am

from : http://wangrusheng5200.javaeye.com/blog/519801

在bash脚本中用到let指令进行算法运算,可是在更换了文件系统后,运行该脚本报错“let: not found”。

在google找到了答案: 脚本中的指定的解析器为”!/bin/sh”, 而在运行平台上,/bin/sh指向了dash而不是bash,dash不支持let命令。解决的方法是将脚本中的解析器改为“!/bin/bash”即可。

dash是UBUNTU上默认的shell解析器, 与bash相比,它更小运行更快,当然它的功能也弱一些。例如在Ubuntu7.0上,bash有700k, 而dash只有70k。

另外, “echo $0″可以看到当前使用的shell。

关于shell中的expr使用问题

Filed under: 網上收隼 — Tags: , , — KAV @ 11:05 am

from :ttp://hi.baidu.com/zheng918/blog/item/a19c08d1a0ac63d5572c8481.html

expr命令一般用于整数值,但也可用于字符串。一般格式为:
expr argument operator argument
expr也是一个手工命令行计数器。
(more…)

Powered by WordPress