📄 00000006.htm
字号:
VARIABLE_NAME"。要去除一个变数则用 unset。 <BR> <BR>------------------------------ <BR> <BR>Subject: How can I tell if I am running an interactive shell? <BR>><I>From: <A HREF="mailto:wicks@dcdmjw.fnal.gov">wicks@dcdmjw.fnal.gov</A> (Matthew Wicks) </I><BR>><I>From: <A HREF="mailto:dws@ssec.wisc.edu">dws@ssec.wisc.edu</A> (DaviD W. Sanderson) </I><BR>Date: Fri, 23 Oct 92 11:59:19 -0600 <BR> <BR>5.5) 要如何得知是否是在一 interactive shell 中? <BR> <BR> 在 C shell 类中,看看 $prompt 这个变数便知分晓。 <BR> <BR> 在 Bourne shell 类中,可以看 $PS1 这个变数,不过最好是检查 $- 这个变 <BR> 数。假如 $- 里有 i,那就表示是在 interactive shell 中。作法如下: <BR> <BR> case $- in <BR> *i*) # do things for interactive shell <BR> ;; <BR> *) # do things for non-interactive shell <BR> ;; <BR> esac <BR> <BR>------------------------------ <BR> <BR>Subject: What "dot" files do the various shells use? <BR>><I>From: <A HREF="mailto:wicks@dcdmjw.fnal.gov">wicks@dcdmjw.fnal.gov</A> (Matthew Wicks) </I><BR>><I>From: <A HREF="mailto:tmb@idiap.ch">tmb@idiap.ch</A> (Thomas M. Breuel) </I><BR>Date: Wed, 28 Oct 92 03:30:36 +0100 <BR> <BR>5.6) 那些以 "." 开始其档名的档案在各种 shell 中的用途为何? <BR> <BR> 下面的说明或许不尽完整,但应该讲的都讲了。 <BR> <BR> csh <BR> 有一些版本在系统中所有使用者都必须读取的 .cshrc 与 .login。不 <BR> 过,每一个版本放置这些档案的地方不大相同。 <BR> <BR> 启动 (依照所列顺序): <BR> .cshrc - 每次都会读取 <BR> .login - login shell 才会读取 <BR> <BR> 结束之前: <BR> .logout - login shells. <BR> <BR> 其他: <BR> .history - 储存history (根据 $savehist 的值决定大小). <BR> <BR> tcsh <BR> 启动 (依照所列顺序): <BR> /etc/csh.cshrc - 每次都会读取 <BR> /etc/csh.login - login shells 才会读取 <BR> .tcshrc - 每次都会读取 <BR> .cshrc - 假如没有 .tcshrc 在的话 <BR> .login - login shells 才会读取 <BR> <BR> 结束之前: <BR> .logout - login shells 才会读取. <BR> <BR> 其他: <BR> .history - saves the history (based on $savehist). <BR> .cshdirs - saves the directory stack. <BR> <BR> sh <BR> 启动 (依照所列顺序): <BR> /etc/profile - login shell 才会读取 <BR> .profile - login shell 才会读取 <BR> <BR> 结束之前: <BR> any command (or script) specified using the command: <BR> trap "command" 0 <BR> <BR> ksh <BR> 启动 (依照所列顺序): <BR> /etc/profile - login shells 才会读取 <BR> .profile - login shells 才会读取 <BR> $ENV - always, if it is set. <BR> <BR> 结束之前: <BR> 如果你用了 trap "command" 0,则结束之际会执行 "command" ( <BR> <BR> bash <BR> 启动 (依照所列顺序): <BR> /etc/profile - login shell 才会读取 <BR> .bash_profile - login shell 才会读取 <BR> .profile - 如果没有 .bash_profile,则会在 login 时读取 <BR> .bashrc - interactive non-login shell 才会读取 <BR> $ENV - 若有设定则读取之 <BR> <BR> 结束之前: <BR> .bash_logout - login shell 读取之 <BR> <BR> 其他: <BR> .inputrc - Readline 初始化之时 <BR> zsh <BR> 启动 (依照所列顺序): <BR> .zshenv - 若无 -f 就会读取 <BR> .zprofile - login shell 才会读取 <BR> .zshrc - interactive shell 若无 -f 就会读取 <BR> .zlogin - login shell 结束之前 <BR> <BR> 结束之前: <BR> .zlogout - login shell 才会读取 <BR> <BR> rc <BR> 启动 (依照所列顺序): <BR> .rcrc - login shell 才会读取 <BR> <BR>------------------------------ <BR> <BR>Subject: I would like to know more about the differences ... ? <BR>><I>From: <A HREF="mailto:wicks@dcdmjw.fnal.gov">wicks@dcdmjw.fnal.gov</A> (Matthew Wicks) </I><BR>Date: Wed, 7 Oct 92 14:28:18 -0500 <BR> <BR>5.7) 我想要知道更多各种 shell 的相异之处。请指点明路。 <BR> <BR> 你可以用 anonymous ftp 在下列地点取得一份有关 sh、tcsh、ksh、 <BR> bash、zsh 与 rc 的详细比较。 <BR> <BR> cs.uwp.edu (131.210.1.4):pub/vi/docs/shell-101.BetaA.Z <BR> utsun.s.u-tokyo.ac.jp:misc/vi-archive/docs/shell-101.BetaA.Z <BR> <BR> 这个档案中比较了呼叫 shell 时的旗号、程式的文法、输出/入之转向、与环 <BR> 境变数。不过这个档案并不讨论以 "." 为档名开头的档案以及环境变数与 <BR> 函数的继承。 <BR> <BR>------------------------------ <BR> <BR>End of unix/faq Digest part 5 of 7 <BR>********************************** <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -