问一下deepin用的什么shell
Tofloor
poster avatar
187******69
deepin
2018-05-07 17:18
Author
如题想知道 deepin 用的什么 shell?
我最近在 学 shell 脚本编程,发现 ((i++)) 格式自增运算无法正常运行,总是报错,我想请教下是什么原因,或者我看的教程太老了???有没有大神帮忙解答下。。。
先谢谢了!
Reply Favorite View the author
All Replies
avatar
honwhywang
deepin
2018-05-07 17:22
#1
ps命令查看一下
Reply View the author
avatar
macro
deepin
2018-05-07 17:49
#2
应该是bash的
Reply View the author
avatar
jiangzm
deepin
2018-05-07 18:18
#3
export $SHELL查看系统当前使用shell
Reply View the author
avatar
ritter
deepin
2018-05-08 01:25
#4
编程问题两步走:
1)贴错误提示
2)如果允许,贴出源代码
否则神仙也帮不了你。。。。。。
Reply View the author
avatar
152******80
Advanced Packager
2018-05-08 01:40
#5
多半写错了
Reply View the author
avatar
187******69
deepin
2018-05-08 22:29
#6
https://bbs.deepin.org/post/156144
编程问题两步走:
1)贴错误提示
2)如果允许,贴出源代码

#!/bin/bash
i=0
while [ $i -lt 10 ];do
echo $i
((i++))
done

以上就是源码
每次运行无限循环
输出为 0
((i++))根本无用

麻烦解答下
Reply View the author
avatar
要讲武德
deepin
2018-05-08 23:53
#7
cat /etc/shells  查看所有shell

echo $SHELL  查看当前使用的shell
Reply View the author
avatar
ritter
deepin
2018-05-09 02:45
#8
https://bbs.deepin.org/post/156144
#!/bin/bash
i=0
while [ $i -lt 10 ];do

我这儿没问题。
你用“bash filename.sh(.bash)”来运行试试看。
Reply View the author