new-exp8.sub

来自「android-w.song.android.widget」· SUB 代码 · 共 96 行

SUB
96
字号
pat1='str'pat2='[^;]'pat3='[[:alnum:]_]'pat4='[[:alnum:]][[fu]b'pat5='?tr'pat6='?tr\'pat7='[[:alnum:]]_'pat8='*tr'declare z="start"declare NUM=1000#----------------------------------# create a long string with ';'#----------------------------------for ((i=0; i<$NUM; i++)); do    z="$z;string$i"done#z="$z;string;foo"#------------------------------# delete everything except ';'#------------------------------# try different patterns herex="${z//$pat1}"echo $xx="${z//$pat2}"echo $xx="${z//$pat3}"echo $xx="${z//$pat4}"echo $xx="${z//$pat5}"echo $xx="${z//$pat6}"echo $xx="${z//$pat7}"echo $xx="${z//$pat8}"echo $xdeclare z="start"declare NUM=1000#----------------------------------# create a long string with ';'#----------------------------------for ((i=0; i<$NUM; i++)); do    z="$z;string$i"done#z="$z;string;foo"#------------------------------# delete everything except ';'#------------------------------# try different patterns herex="${z//[^;]}"echo $xx="${z/#[^;][^;]}"echo $xx="${z/%[^;][^;]}"echo $xexport LANG=C LC_ALL=C LC_CTYPE=C# try different patterns herex="${z//$pat1}"echo $xx="${z//$pat2}"echo $xx="${z//$pat3}"echo $xx="${z//$pat4}"echo $xx="${z//$pat5}"echo $xx="${z//$pat6}"echo $xx="${z//$pat7}"echo $xx="${z//$pat8}"echo $x# try different patterns herex="${z//[^;]}"echo $xx="${z/#[^;][^;]}"echo $xx="${z/%[^;][^;]}"echo $x

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?