cshrc的设置实例

An example .cshrc file for CSCI 3308 for use in the CSEL

This file (.cshrc) is run every time you spawn a tcsh shell.

This includes every time you open a new Terminal window

(as this action spawns a new shell)

####################################################################

Set the ARCH environment variable before setting the path;

This allows you to add architecture-specific directories

to your path

if (! $?ARCH) then
setenv ARCH /usr/local/bin/arch
endif

if (! $?UNAME) then
setenv UNAME uname
endif

set packages = ( netscape gcc-3.3 j2sdk Acrobat mathematica news )
setenv MANPATH /tools/cs/man

set pathadd = “”
foreach p ( p a c k a g e s ) i f ( − d / t o o l s / c s / packages ) if ( -d /tools/cs/ packages)if(d/tools/cs/p ) then
set pathadd = ( p a t h a d d / t o o l s / c s / pathadd /tools/cs/ pathadd/tools/cs/p/bin )
setenv MANPATH M A N P A T H : / t o o l s / c s / {MANPATH}:/tools/cs/ MANPATH:/tools/cs/p/man
endif
end

if ( -d /usr/share/man ) then
setenv MANPATH ${MANPATH}:/usr/share/man
else
setenv MANPATH ${MANPATH}:/usr/man
endif

first merge $path and $pathadd

set path = ( $pathadd $path )

then get rid of pathadd variable

unset pathadd

now add additional paths

set path = ( $HOME/bin $path )

setenv MANPATH ${MANPATH}:/usr/local/man:/usr/local/X11/man

basic info about the host/user

if (! $?USER) then
setenv USER whoami
endif

if (! $?HOST) then
setenv HOST hostname
endif

Set the editor to use (usually vi).

setenv EDITOR vi

setenv PAGER less

how many commands to keep in the history database

set history = 200
set savehist = 800 merge

standard csh features

set filec # enable filename completion
set notify # report status of background jobs immediately
set noclobber # don’t clobber existing files
set nomatch # not an error if ‘*’ matches nothing

tcsh-specific features

if ($?tcsh != 0) then
set prompt="[%m:%c3] %n % "
limit coredumpsize 1k
unset autologout # don’t log me off after a set idle time
set echo_style both # emulate bsd and sysV /bin/echo’s
set addsuffix # / on dir during file name completion
set ampm # show times in 12 hr. format
set autolist # list possibilities for file name completion
set autoexpand # expand history automatically with
endif

Some useful Aliases.

alias ls “ls -F”
alias rm “rm -i”
alias mv “mv -i”
alias cp “cp -i”

Unalias some non-useful aliases

unalias l.
unalias ll
unalias mc

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值