echo "this is the ${num}nd"
let "var+=1"
var=$[$var+1]
var=`expr $var + 1`
就是这个了..
antsilence@ubuntu:~$ ./first
antsilence@ubuntu:~$
这是结果..那里出现了错误?
shell基础教程上到按照方法运行无法得到哦相应到结果
-
- 帖子: 14
- 注册时间: 2011-02-26 16:14
- 联系:
shell基础教程上到按照方法运行无法得到哦相应到结果
不知道为什么,就是喜欢去弄那些根本不可能明白的东西...没天才到脑子,但是有精神病般的思想
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: shell基础教程上到按照方法运行无法得到哦相应到结果
代码: 全选
[maple@maple Desktop]$ chmod +x first.sh
[maple@maple Desktop]$ ./first.sh
this is the nd
[maple@maple Desktop]$
-
- 帖子: 14
- 注册时间: 2011-02-26 16:14
- 联系:
Re: shell基础教程上到按照方法运行无法得到哦相应到结果
需要加.sh?枫叶饭团 写了:代码: 全选
[maple@maple Desktop]$ chmod +x first.sh [maple@maple Desktop]$ ./first.sh this is the nd [maple@maple Desktop]$
我开头是#!/bin/bash
不知道为什么,就是喜欢去弄那些根本不可能明白的东西...没天才到脑子,但是有精神病般的思想
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: shell基础教程上到按照方法运行无法得到哦相应到结果
#!/bin/bash
.sh是我一不小心习惯性的加上的。。。
.sh是我一不小心习惯性的加上的。。。