csh.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 2,332 行 · 第 1/5 页

1
2,332
字号
ignored for the remainder of the script.The second form causes the specified command to be run with hangupsignored.All processes detached with `&' are effectively.I nohup'ed..HP 5.B notify.NXR "notify command (csh)".br.ns.HP 5\fBnotify\ %\fRjob\ ....brCauses the shell to notify the user asynchronously when the status of thecurrent or specified jobs changes; normally notification is presentedbefore a prompt.  This is automatic if the shell variable.I notifyis set..HP 5.B  onintr.NXR "onintr command (csh)".br.ns.HP 5.BR onintr "  \-".br.ns.HP 5.BR onintr "  label".brControl the action of the shell on interrupts.The first form restores the default action of the shell on interruptswhich is to terminate shell scripts or to return to the terminal commandinput level.The second form `onintr \-' causes all interrupts to be ignored.The final form causes the shell to execute a `goto label' whenan interrupt is received or a child process terminates becauseit was interrupted..IPIn any case, if the shell is running detached and interrupts arebeing ignored, all forms of.I onintrhave no meaning and interruptscontinue to be ignored by the shell and all invoked commands..HP 5.BR "popd".NXR "popd command (csh)".br.ns.HP 5.BR "popd" " +n".brPops the directory stack, returning to the new top directory.With a argument `+\fIn\fR' discards the \fIn\fR\|thentry in the stack.The elements of the directory stack are numbered from 0 starting at the top..HP 5.BR "pushd".NXR "pushd command (csh)".br.ns.HP 5.BR "pushd" " name".br.ns.HP 5.BR "pushd" " +n".brWith no arguments,.B pushdexchanges the top two elements of the directory stack.Given a.I nameargument,.B pushdchanges to the new directory (using.PN cd)and pushes the old current working directory(as in.I csw)onto the directory stack.With a numeric argument, rotates the \fIn\fR\|th argument of the directorystack around to be the top element and changes to it.  The membersof the directory stack are numbered from the top starting at 0..HP 5.BR rehash.NXR "rehash command (csh)".brCauses the internal hash table of the contents of the directories inthe.I pathvariable to be recomputed.  This is needed if new commands are addedto directories in the.I pathwhile you are logged in.  This should only be necessary if you addcommands to one of your own directories, or if a systems programmerchanges the contents of one of the system directories..HP 5.BR repeat " count command".NXR "repeat command (csh)".brThe specified .I commandwhich is subject to the same restrictionsas the.I commandin the one line.I ifstatement above,is executed.I counttimes.I/O redirections occur exactly once, even if.I countis 0..HP 5.B  set.NXR "set command (csh)".br.ns.HP 5.BR set " name".br.ns.HP 5.BR set " name=word".br.ns.HP 5.BR set " name[index]=word".br.ns.HP 5.BR set " name=(wordlist)".brThe first form of the command shows the value of all shell variables.Variables which have other than a single word as value print as a parenthesizedword list.The second form sets.I nameto the null string.The third form sets.I nameto the single.I word.The fourth form setsthe.I index'thcomponent of name to word;this component must already exist.The final form sets.I nameto the list of words in.I wordlist.In all cases the value is command and file name expanded..IPThese arguments may be repeated to set multiple values in a single set command.Note however, that variable expansion happens for all arguments before anysetting occurs..HP 5.BR setenv " name value".NXR "setenv command (csh)".brSets the value of environment variable.I nameto be.I value,a single string.The most commonly used environment variable USER, TERM, and PATHare automatically imported to and exported from the.PN cshvariables.I user,.I term,and.I path;there is no need to use.I setenvfor these..HP 5.B  shift.NXR "shift command (csh)".br.ns.HP 5.BR shift " variable".brThe members of.I argvare shifted to the left, discarding.I argv[1].It is an error for.I argvnot to be set or to have less than one word as value.The second form performs the same function on the specified variable..HP 5.BR source " name".NXR "source command (csh)".br.ns.HP 5.BR "source \-h" " name".brThe shell reads commands from.I name..I Sourcecommands may be nested; if they are nested too deeply the shell mayrun out of file descriptors.An error in a.I sourceat any level terminates all nested.I sourcecommands.Normally input during .I sourcecommands is not placed on the history list;the \-h option causes the commands to be placed in thehistory list without being executed..HP 5.B stop.NXR "stop command (csh)".br.ns.HP 5\fBstop\ %\fRjob\ ....brStops the current or specified job which is executing in the background..HP 5.B suspend.NXR "suspend command (csh)".br.nsCauses the shell to stop in its tracks, much as if it had been sent a stopsignal with \fB^Z\fR.  This is most often used to stop shells started by.MS su 1 ..HP 5.BR switch " (string)".NXR "switch command (csh)".br.ns.HP 5.BR case " str1:".br.ns.HP 5\    ....br.ns.HP 5\   .B  breaksw.br.ns.HP 5\&....br.ns.HP 5.B  default:.br.ns.HP 5\    ....br.ns.HP 5\   .B  breaksw.br.ns.HP 5.B  endsw.brEach case label is successively matched, against the specified.I stringwhich is first command and file name expanded.The file metacharacters `*', `?' and `[...]' may be used in the case labels,which are variable expanded.If none of the labels match before a `default' label is found, thenthe execution begins after the default label.Each case label and the default label must appear at the beginning of a line.The command .I breakswcauses execution to continue after the.I endsw.Otherwise control may fall through case labels and default labels as in C.If no label matches and there is no default, execution continues afterthe.I endsw..HP 5.B  time.NXR "time command (csh)".br.ns.HP 5.BR time " command".brWith no argument, a summary of time used by this shell and its childrenis printed.If arguments are giventhe specified simple command is timed and a time summaryas described under the.I timevariable is printed.  If necessary, an extra shell is created to print the timestatistic when the command completes..HP 5.B umask.NXR "umask command (csh)".br.ns.HP 5.BR umask " value".brThe file creation mask is displayed (first form) or set to the specifiedvalue (second form).  The mask is given in octal.  Common values forthe mask are 002 giving all access to the group and read and executeaccess to others or 022 giving all access except no write access forusers in the group or others..HP 5.BR unalias " pattern".NXR "unalias command (csh)".brAll aliases whose names match the specified pattern are discarded.Thus all aliases are removed by `unalias *'.It is not an error for nothing to be.I unaliased..HP 5.BR unhash.NXR "unhash command (csh)".brUse of the internal hash table to speed location of executed programsis disabled..HP 5\fBunlimit\fR \fIresource\fR.br.ns.HP 5\fBunlimit\fR.NXR "unlimit command (csh)".brRemoves the limitation on \fIresource\fR.  If no \fIresource\fRis specified, then all \fIresource\fR limitations are removed..HP 5.BR unset " pattern".NXR "unset command (csh)".brAll variables whose names match the specified pattern are removed.Thus all variables are removed by `unset *'; this has noticeablydistasteful side-effects.It is not an error for nothing to be.I unset..HP 5.BR unsetenv " pattern".NXR "unsetenv command (csh)".brRemoves all variables whose name match the specified pattern from theenvironment.  See also the.I setenvcommand above and.MS printenv 1 ..HP 5.B  wait.NXR "wait command (csh)".brAll background jobs are waited for.It the shell is interactive, then an interrupt can disrupt the wait,at which time the shell prints names and job numbers of all jobsknown to be outstanding..HP 5.BR while " (expr)".NXR "while command (csh)".br.ns.HP 5\    ....br.ns.HP 5.B  end.NXR "end command (csh)".brWhile the specified expression evaluates non-zero, the commands betweenthe.I whileand the matching end are evaluated..I Breakand.I continuemay be used to terminate or continue the loop prematurely.(The.I whileand.I endmust appear alone on their input lines.)Prompting occurs here the first time through the loop as for the.I foreachstatement if the input is a terminal..HP 5\fB%\fRjob.brBrings the specified job into the foreground..HP 5\fB%\fRjob \fB&\fR.brContinues the specified job in the background..HP 5.B "@".br.ns.HP 5.BR "@" " name = expr".br.ns.HP 5.BR "@" " name[index] = expr".brThe first form prints the values of all the shell variables.The second form sets the specified.I nameto the value of.I expr.If the expression contains `<', `>', `&' or `|' then at leastthis part of the expression must be placed within `(' `)'.The third form assigns the value of.I exprto the.I index'thargument of.I name.Both .I nameand its.I index'thcomponent must already exist..IPThe operators `*=', `+=', etc are available as in C.The space separating the name from the assignment operator is optional.Spaces are, however, mandatory in separating components of.I exprwhich would otherwise be single words..IPSpecial postfix `++' and `\-\|\-' operators increment and decrement.I namerespectively, that is `@  i++'..SH Pre-defined And Environment Variables.NXR "csh command interpreter" "variables"The following variables have special meaning to the shell.Of these,.I argv,.I cwd,.I home,.I path,.I prompt,.I shelland.I statusare always set by the shell.Except for.I cwdand.I statusthis setting occurs only at initialization;these variables will not then be modified unless this is doneexplicitly by the user..PPThis shell copies the environment variable USER into the variable.I user,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?