logo
  • 教程列表
  • SO官方文档
  • Bash 参数扩展
    • 修改字母字符的大小写
    • 参数长度
    • 替换字符串中的模式
    • 子字符串和子阵列
    • 从字符串的开头删除模式
    • 参数间接
    • 默认值替换
    • 从字符串末尾删除模式
    • 参数扩展和文件名
    • 如果变量为空或未设置,则会出错
    • Munging 在扩张期间
  1. StackOverflow 文档
  2. Bash 教程
  3. Bash 参数扩展
  4. 从字符串末尾删除模式

从字符串末尾删除模式

Created: November-22, 2018

最短匹配:

$ a='I am a string'
$ echo "${a%a*}"
I am 

最长的匹配:

$ echo "${a%%a*}"
I 
  • 参数扩展和文件名
  • 默认值替换

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明