LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1012|回复: 2

expr index 的问题

[复制链接]
发表于 2006-12-26 19:56:06 | 显示全部楼层 |阅读模式
expr index 索引子串第一个字符在字符串的位置, 前面的都正确,但最后一个就成2了???
    如下:
           $a=abcABC123abcABC
           $expr index "$a" A
             4
           $expr index "$a" 123
             7
           $expr index "$a" ABC
             4
           $expr index "$a" Abc
             2
发表于 2006-12-27 12:28:37 | 显示全部楼层
  1. $man expr | grep index
  2. Reformatting expr(1), please wait...
  3.        index STRING CHARS
  4.               index in STRING where [color=Red]any CHARS[/color] is found, or 0
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-12-29 00:40:39 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表