Shell字符串截取 - Xiao-Le Deng (邓小乐)

Xiao-Le Deng (邓小乐)

BlogPublicationsTagsSearchAbout

Shell字符串截取

2024-01-02
#Unix #Shell
# 截取字符串 $string 的后 3 个字符
string="abcdefg"
echo "${string: -3}"  # 输出:efg

延伸阅读

  • shell 截取字符串后几位-掘金
  • linux shell 字符串操作详解 (长度,读取,替换,截取,连接,对比,删除,位置 )-云社区-华为云
——
2012 – 2025 © Xiao-Le Deng · Powered by Simple Style