sh与csh中的算符优先顺序
第一个脚本(1.sh):
#!/bin/sh
echo test
exit 1
测试命令:./1.sh | grep test && echo 1
csh:
./1.sh | grep test && echo e
test
sh:
./1.sh | grep test && echo e
test
e
共 4 篇文章。
第一个脚本(1.sh):
#!/bin/sh
echo test
exit 1
测试命令:./1.sh | grep test && echo 1
csh:
./1.sh | grep test && echo e
test
sh:
./1.sh | grep test && echo e
test
e
以前一直以为不行的,今天仔细看了一下manpage:
如欲让sysctl之后能使用tab补齐,则应使用:
complete sysctl ’n/*/`sysctl -Na`/'
试了一下,不错!
对GBK的locale做了一些改动,使得其能够提供正确的字符宽度信息了。这样一来,csh就能够正确处理GBK的中文了。昨天还增加了正体(我们叫做繁体)中文对应的locale变化。
Just for fun:
Add the following to your /etc/csh.cshrc:
setenv LSCOLORS ExGxFxdxCxegedabagExEx
setenv CLICOLOR yes
set prompt = ‘[%B%n@%m%b] %B%~%b%# ’
set autolist
bindkey “^W” backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
And execute:
sed -i.bak -E s/set\ prompt/#set\ prompt/g /root/.cshrc
Then re login.