⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 array6.sub

📁 android-w.song.android.widget
💻 SUB
字号:
# test cases for array quoting and escaping fixed post bash-3.2-releaseoIFS="$IFS"a=(a b c)echo ${a[@]}a2=("${a[@]/#/"-iname '"}")recho "${a2[@]}"echo "${dbg-"'hey'"}"echo "${dbg-"hey"}"echo "${dbg-'"'hey}"echo "${dbg-'"hey'}"unset a a2IFS=a2=(${a[@]/#/"-iname '"})recho "${a2[@]}"IFS="$oIFS"unset a a2a=('a b' 'c d' 'e f')recho ${a[@]:1:2}recho "${a[@]:1:2}"IFS=recho ${a[@]:1:2}recho "${a[@]:1:2}"IFS="$oIFS"unset a a2a=(abc def)# Prevent word splitting#IFS= a2=("${a[@]/#/"-iname '"}") recho "${a2[@]}"eval a2=("${a[@]/#/"-iname '"}") recho "${a2[@]}"a2=("${a[@]/#/-iname \'}") recho "${a2[@]}"eval a2=("${a[@]/#/-iname \'}") recho "${a2[@]}"set -- abc defa2=("${@/#/"-iname '"}") recho "${a2[@]}"eval a2=("${@/#/"-iname '"}") recho "${a2[@]}"unset a a2IFS=pat=('*.*')case $(ls ${pat[@]} 2>/dev/null) in'')	echo '*.* BAD' ;;*)	echo '*.* OK' ;;esacIFS="$oIFS"unset a a2 patIFS=s='abc'set - ${s/b/1 2 3}echo $#echo "$1"IFS="$oIFS"unset sset -- ab cd effoo="var with spaces"IFS=recho $foorecho "$foo"recho ${foo}"$@"recho ${foo}$@array=(ab cd ef)recho ${foo}"${array[@]}"recho ${foo}${array[@]}recho $(echo $foo)"$@"recho $(echo $foo)$@a=('word1 with spaces' 'word2 with spaces')set - ${a[@]/word/element}echo $#recho "$@"recho $@IFS="$oIFS"unset a a2 array foo

⌨️ 快捷键说明

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