当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Linux 指令篇:字串处理--expr

Unix/Linux
Linux 指令篇:系统管理--rwho
Linux 指令篇:系统管理--screen
Linux 指令篇:系统管理--sliplogin
Linux 指令篇:系统管理--suspend
Linux 指令篇:系统管理--swatch
Linux 指令篇:系统管理--tload
Linux 指令篇:系统设置--chkconfig
Linux 指令篇:系统设置--chroot
Linux 指令篇:系统设置--clock
Linux 指令篇:系统设置--declare
Linux 指令篇:系统设置--depmod
Linux 指令篇:系统设置--dircolors
Linux 指令篇:系统设置--dmesg
Linux 指令篇:系统设置--enable
Linux 指令篇:系统设置--eval
Linux 指令篇:系统设置--export
Linux 指令篇:系统设置--fbset
Linux 指令篇:系统设置--grpconv
Linux 指令篇:系统设置--grpunconv
Linux 指令篇:系统设置--hwclock

Unix/Linux 中的 Linux 指令篇:字串处理--expr


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 114 ::
收藏到网摘: n/a

  名称:expr 

### 字串长度

shell>> expr length "this is a test"
14

### 数字商数

shell>> expr 14 % 9
5

### 从位置处抓取字串

shell>> expr substr "this is a test" 3 5
is is

### 数字串 only the first character

shell>> expr index "testforthegame" e
2

### 字串真实重现

shell>> expr quote thisisatestformela
thisisatestformela