从路径中截取文件名, basename ## %% # %

 

${##xx} 是贪婪匹配移除prefix xx

$(#xx) 是非贪婪匹配移除prefix 

$(%xx) 是贪婪匹配移除sufix

$(%x) 是非贪婪匹配移除sufix

 

资料:

https://stackoverflow.com/questions/16029185/what-does-in-shell-script-means

https://www.cyberciti.biz/faq/bash-get-filename-from-given-path-on-linux-or-unix/

 

posted @ 2021-07-08 11:25  hh9515  阅读(341)  评论(0)    收藏  举报