Bash 取字符串的最后 N 个字符: ${str:0-N:LENGTH} or ${str:0-N}

https://tldp.org/LDP/abs/html/string-manipulation.html

> file_name=/app/xxx/yyy/zzz.20210915

> echo echo ${file_name:0-8}
20210915

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-09-17
相关资源
相似解决方案