BASH
更新:HHH   时间:2023-1-7


 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

 

 

返回软件技术教程...