专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell指令篇>

expr 计算字串长度等

百度收藏 QQ搜藏
指令名称:expr
功能介绍:可以对字符串进行各种处置
语法格式:expr
常用参数说明:
指令使用实例:
1.字串长度
  shell>> expr length "this is a test"
  14
2.数字商数
  shell>> expr 14 % 9
  5
3.从位置处抓取字串
  shell>> expr substr "this is a test" 3 5
  is is
4.数字串 only the first character
  shell>> expr index "testforthegame" e
  2
5.字串真实重现
  shell>> expr quote thisisatestformela
  thisisatestformela
上一篇:tr 字组转换器 下一篇:uniq 检查文本重复行列

power by soyo123 2007-2008