linux 中%.*、%%.*的意义
1、举例%.*的作用
root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# echo ${a%.*} ## %.*的作用是删除变量最后一个.及其后的内容 aa.bb.cc
root@DESKTOP-1N42TVH:/home/test3# a="2e.@#.%34.3#@$" root@DESKTOP-1N42TVH:/home/test3# echo ${a} 2e.@#.%34.3#@$ root@DESKTOP-1N42TVH:/home/test3# echo ${a%.*} ## %.*的作用是删除变量最有一个.及其后的内容。 2e.@#.%34
2、举例:%%.*的作用
root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# echo ${a%%.*} ## %%.*的作用是删除变量第一个.及其后的内容 aa
参考:https://blog.csdn.net/qq_30130417/article/details/80911989
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号