+ -
当前位置:首页 → 问答吧 → 很简单的脚本哪里出错【求助】

很简单的脚本哪里出错【求助】

时间:2011-02-27

来源:互联网

echo "this is the ${num}nd"
let "var+=1"
var=$[$var+1]
var=`expr $var + 1`
就是这个了..

antsilence@ubuntu:~$ ./first
antsilence@ubuntu:~$
这是结果..那里出现了错误?

作者: 晦月影   发布时间: 2011-02-27

代码:
[maple@maple Desktop]$ chmod +x first.sh
[maple@maple Desktop]$ ./first.sh
this is the nd
[maple@maple Desktop]$

作者: 枫叶饭团   发布时间: 2011-02-27

枫叶饭团 写道:
代码:
[maple@maple Desktop]$ chmod +x first.sh
[maple@maple Desktop]$ ./first.sh
this is the nd
[maple@maple Desktop]$

需要加.sh?
我开头是#!/bin/bash

作者: 晦月影   发布时间: 2011-02-27

#!/bin/bash
.sh是我一不小心习惯性的加上的。。。

作者: 枫叶饭团   发布时间: 2011-02-27