[solved]shell下的类似a++

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
numbchild
帖子: 107
注册时间: 2010-03-16 12:34

[solved]shell下的类似a++

#1

帖子 numbchild » 2011-01-29 22:48

在c下面有a++来实现自动加1
shell下要怎么实现,或者用for()?
能写个例子吗?小弟初学bash,谢谢指教
上次由 numbchild 在 2011-01-30 13:55,总共编辑 1 次。
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: shell下的类似a++

#2

帖子 cnkilior » 2011-01-29 22:58

$(())
头像
numbchild
帖子: 107
注册时间: 2010-03-16 12:34

Re: shell下的类似a++

#3

帖子 numbchild » 2011-01-29 23:05

cnkilior 写了:$(())
$(($num)+1)?
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30

Re: shell下的类似a++

#4

帖子 aerofox » 2011-01-30 6:08

代码: 全选

((a++))
回复