android_mt6572_jiabo/external/bash/tests/nquote1.tests
2025-09-05 16:56:03 +08:00

97 lines
1.2 KiB
Text
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

a=$'a\001b'
set $a
b=$a
c=$1
d="$1"
e=$'uv\001\001wx'
recho a $a ${#a}
recho 1 $1 ${#1}
recho b $b ${#b}
recho c $c ${#c}
recho d $d ${#d}
recho a ${a} ${#a}
recho 1 ${1} ${#1}
recho b ${b} ${#b}
recho c ${c} ${#c}
recho d ${d} ${#d}
recho a "$a" ${#a}
recho 1 "$1" ${#1}
recho b "$b" ${#b}
recho c "$c" ${#c}
recho d "$d" ${#d}
recho a "${a}" ${#a}
recho 1 "${1}" ${#1}
recho b "${b}" ${#b}
recho c "${c}" ${#c}
recho d "${d}" ${#d}
set $e
recho e1 ${e:1:3}
recho e2 "${e:1:3}"
recho e3 ${1:1:3}
recho e4 "${1:1:3}"
arr[0]=$e
arr[1]=$e
recho a1 ${arr:0:4}
recho a2 "${arr:0:4}"
recho a3 ${arr[@]:0:2}
recho a4 "${arr[@]:0:2}"
set $e $e
recho p1 ${@:1:2}
recho p2 "${@:1:2}"
recho p1 ${*:1:2}
recho p2 "${*:1:2}"
recho $e
recho 'uvwx'
f='uvwx'
recho $f
echo -en "\01" | cat -v
echo
huhu() { echo "$1"; };
huhu $(echo -en "\01") | cat -v
huhu $(echo -en "\02") | cat -v
f=$'uv\001w\001xy'
set $f $f
recho f1 ${f:1:3}
recho f2 "${f:1:3}"
arr[0]=$f
arr[1]=$f
recho a1 ${arr:0:4}
recho a2 "${arr:0:4}"
recho a3 ${arr[0]:0:4}
recho a4 "${arr[0]:0:4}"
recho e1 ${f:0:4}
recho e2 "${f:0:4}"
recho d1 ${1:2:2}
recho d2 "${1:2:2}"
recho @1 ${@:1:2}
recho @2 "${@:1:2}"