字符串处理

expr index haohao ao
expr length hao,hao
expr substr hao,hao 2 3


[root@red54apple shell]# expr match "hao123" '[0-9]' 
0
[root@red54apple shell]# expr match "123" '[0-9]*'   
3
[root@red54apple shell]# expr match "123d" '[0-9]*
3
等价
[root@red54apple shell]# expr 123 : [0-9]*
3



awk 'BEGIN {while ( "who" | getline n )  print n" haha"}'
参看
http://www.mscto.com/embedded/2009020229747.html
http://www.blogjava.net/xzclog/default.html?page=4

你可能感兴趣的:(expr)