Skip to content

Commit 2a44f26

Browse files
authored
bugfix
1 parent bef4a4b commit 2a44f26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ sh里没有多行注释,只能每一行加一个#号。就像这样:
251251
#### 查找子字符串
252252

253253
string="alibaba is a great company"
254-
echo `expr index "$string" is`#输出:8,这个语句的意思是:找出单词is在这名话中的位置
254+
echo `expr index "$string" is`#输出:3,这个语句的意思是:找出字母i在这名话中的位置,要在linux下运行,mac下会报错
255255

256256
#### 更多
257257
参见本文档末尾的参考资料中[Advanced Bash-Scripting Guid Chapter 10.1](http://tldp.org/LDP/abs/html/string-manipulation.html)

0 commit comments

Comments
 (0)