是什么让tcsh
忽略 \fa 之后的字符?
% set funky = "`perl -e 'print pack q(c*), 9,247..255'`"
% echo "$funky" | od -x
0000000 f709 f9f8 fbfa fdfc fffe 000a
0000013
% set funky = "`perl -e 'print pack q(c*), 10,247..255'`"
% echo "$funky" | od -x
0000000 f8f7 faf9 000a
0000005
csh
才不是:
% set funky = "`perl -e 'print pack q(c*), 9,247..255'`"
% echo "$funky" | od -x
0000000 f709 f9f8 fbfa fdfc fffe 000a
0000013
% set funky = "`perl -e 'print pack q(c*), 10,247..255'`"
% echo "$funky" | od -x
0000000 f8f7 faf9 fcfb fefd 0aff
0000012
% tcsh --version
tcsh 6.18.01 (Astron) 2012-02-14 (x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,nd,color,filec
% dpkg -l csh
ii csh 20110502-2.1u amd64 Shell with C-like syntax
答案1
区域设置:
% setenv LANG C
% set funky = "`perl -e 'print pack q(c*), 10,247..255'`"
% echo "$funky" | od -x
0000000 f8f7 faf9 fcfb fefd 0aff
0000012