BASH – 参数扩展
root@localhost:/root> echo "AA/BB/CC/DD" >> testfile
root@localhost:/root> cat testfile
AA/BB/CC/DD
root@localhost:/root>
要求把后边DD替换掉
root@localhost:/root> TXT=`cat testfile` ; echo ${TXT%%DD}
AA/BB/CC/
root@localhost:/root>
Thinking:
http://www.linuxsir.org/bbs/forum60.html
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/192257.html