csh.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 2,332 行 · 第 1/5 页
1
2,332 行
or.I while.The remaining commands on the current line are executed.Multi-level breaks are thus possible by writing them all on one line..HP 5.B breaksw.NXR "breaksw command (csh)".brCauses a break from a.I switch,resuming after the.I endsw..HP 5.BR case " label:".NXR "case command (csh)" .brA label in a.I switchstatement as discussed below..HP 5.B cd.br.ns.HP 5.BR cd " name".NXR "cd command (csh)".br.ns.HP 5.B chdir.NXR "chdir command (csh)".br.ns.HP 5.BR chdir " name".brChange the shell's working directory to directory.I name.If no argument is given then change to the home directory of the user..brIf.I nameis not found as a subdirectory of the current directory (and does not beginwith `/', `./' or `../'), then eachcomponent of the variable.I cdpathis checked to see if it has a subdirectory.I name.Finally, if all else fails but.I nameis a shell variable whose value begins with `/', then thisis tried to see if it is a directory..HP 5.B continue.NXR "continue command (csh)".brContinue execution of the nearest enclosing.I whileor.I foreach.The rest of the commands on the current line are executed..HP 5.B default:.brLabels the default case in a.I switchstatement.The default should come after all.I caselabels..HP 5.BR "dirs".NXR "dir command (csh)".brPrints the directory stack; the top of the stack is at the left,the first directory in the stack being the current directory..HP 5.BR echo " wordlist".NXR "echo command (csh)".br.ns.HP 5.BR "echo \-n" " wordlist".brThe specified words are written to the shell's standard output, separatedby spaces, and terminated with a new line unless the.B \-noption is specified..HP 5.B else.br.ns.HP 5.B end.br.ns.HP 5.B endif.br.ns.HP 5.B endsw.brSee the description of the.I foreach,.I if,.I switch,and.I whilestatements below..HP 5.BR eval " arg ...".NXR "eval command (csh)".brAs in sh(1).The arguments are read as input to the shell and the resultingcommand(s) executed in the context of the current shell.This is usually used to execute commandsgenerated as the result of command or variable substitution, sinceparsing occurs before these substitutions. See.MS test 1for an example of using.IR eval ..HP 5.BR exec " command".NXR "exec command (csh)".brThe specified command is executed in place of the current shell..HP 5.B exit.br.ns.HP 5.BR exit (expr).NXR "exit command (csh)".brThe shell exits either with the value of the.I statusvariable (first form) or with the value of the specified.I expr(second form)..HP 5.B fg.NXR "fg command (csh)".br.ns.HP 5\fBfg\ %\fRjob\ ....brBrings the current or specified jobs into the foreground, continuing them ifthey were stopped..HP 5.BR foreach " name (wordlist)".NXR "foreach command (csh)".br.ns.HP 5\ ....br.ns.HP 5.B end.NXR "end command (csh)".brThe variable.I nameis successively set to each member of.I wordlistand the sequence of commands between this command and the matching.I endare executed.(Both.I foreachand.I endmust appear alone on separate lines.).IPThe built-in command.I continuemay be used to continue the loop prematurely and the built-incommand.I breakto terminate it prematurely.When this command is read from the terminal, the loop is read up onceprompting with `?' before any statements in the loop are executed.If you make a mistake typing in a loop at the terminal you can rub it out..HP 5.BR glob " wordlist".NXR "glob command (csh)".brLike.I echobut no `\e' escapes are recognized and words are delimitedby null characters in the output.Useful for programs which wish to use the shell to file name expand a listof words..HP 5.BR goto " word".NXR "goto command (csh)".brThe specified.I wordis file name and command expanded to yield a string of the form `label'.The shell rewinds its input as much as possibleand searches for a line of the form `label:'possibly preceded by blanks or tabs.Execution continues after the specified line..HP 5.BR hashstat.NXR "hashstat command (csh)".brPrint a statistics line indicating how effective the internal hashtable has been at locating commands (and avoiding.IR exec 's).An.I execis attempted for each component of the.I pathwhere the hash function indicates a possible hit, and in each componentwhich does not begin with a `/'..HP 5.B history.NXR "history command (csh)".br.ns.HP 5.BI history " n".br.ns.HP 5.BI "history \-r" " n".br.ns.HP 5.BI "history \-h" " n".brDisplays the history event list; if \fIn\fR is given only the.I nmost recent events are printed.The.B \-roption reverses the order of printout to be most recent firstrather than oldest first.The.B \-hoption causes the history list to be printed without leading numbers.This is used to produce files suitable for sourcing using the \-hoption to.IR source ..HP 5.BR if " (expr) command".NXR "if command (csh)".brIf the specified expression evaluates true, then the single.I commandwith arguments is executed.Variable substitution on.IR command ""happens early, at the sametime it does for the rest of the.I ifcommand..I Commandmust be a simple command, nota pipeline, a command list, or a parenthesized command list.Input/output redirection occurs even if.I expris false, when command is.B notexecuted (this is a bug)..HP 5.BR if " (expr) " "then".br.ns.HP 5\ ....br.ns.HP 5.BR else " " "if\fR (expr2) \fBthen".NXR "else command (csh)".br.ns.HP 5\ ....br.ns.HP 5.B else.br.ns.HP 5\ ....br.ns.HP 5.B endif.NXR "endif command (csh)".brIf the specified.IR expr ""is true then the commands to the first.I elseare executed; else if.IR expr2 ""is true then the commands to thesecond else are executed, etc.Any number of.I else-ifpairs are possible; only one.I endifis needed.The.I elsepart is likewise optional.(The words.I elseand.I endifmust appear at the beginning of input lines;the.I ifmust appear alone on its input line or after an.I else.).HP 5.B jobs.NXR "jobs command (csh)".br.ns.HP 5.B "jobs \-l".brLists the active jobs; given the.B \-loptions lists process id's in addition to the normal information..HP 5\fBkill %\fRjob.NXR "kill command (csh)".br.ns.HP 5\fBkill\ \-\fRsig\ \fB%\fRjob\ ....br.ns.HP 5\fBkill\fR\ pid.br.ns.HP 5\fBkill\ \-\fRsig\ pid\ ....br.ns.HP 5\fBkill\ \-l\fR.brSends either the TERM (terminate) signal or thespecified signal to the specified jobs or processes.Signals are either given by number or by names (as given in.I /usr/include/signal.h,stripped of the prefix ``SIG'').The signal names are listed by ``kill \-l''.There is no default, saying just `kill' does notsend a signal to the current job.If the signal being sent is TERM (terminate) or HUP (hangup),then the job or process will be sent a CONT (continue) signal as well..HP\fBlimit\fR.NXR "limit command (csh)".br.ns.HP 5\fBlimit\fR \fIresource\fR.br.ns.HP 5\fBlimit\fR \fIresource\fR \fImaximum-use\fR.brLimits the consumption by the current process and each processit creates to not individually exceed \fImaximum-use\fR on thespecified \fIresource\fR. If no \fImaximum-use\fR is given, thenthe current limit is printed; if no \fIresource\fR is given, thenall limitations are given..IPThe following resources can be controlled:.IP \(bu 5\fIcputime\fR (maximum number of cpu-seconds to be used by each process) .IP \(bu 5\fIfilesize\fR (largest single file which can be created).IP \(bu 5\fIdatasize\fR (the maximum growth of the data+stack region by.MS sbrk 2beyond the end of the program text).IP \(bu 5\fIstacksize\fR (the maximum size of the automatically-extended stack region).IP \(bu 5\fIcoredumpsize\fR (the size of the largest core dump that can be created)..IP \(bu 5\fImemoryuse\fR (the maximum amount of main memory a process is allowedto occupy).IPThe \fImaximum-use\fR may be given as a (floating point or integer)number followed by a scale factor. For all limits other than \fIcputime\fRthe default scale is `k' or `kilobytes' (1024 bytes);a scale factor of `m' or `megabytes' may also be used.For.I cputimethe default scaling is `seconds', while `m' for minutesor `h' for hours, or a time of the form `mm:ss' giving minutesand seconds may be used..IPFor both \fIresource\fR names and scale factors, unambiguous prefixesof the names suffice..HP 5.B login.NXR "login command (csh)".brTerminate a login shell, replacing it with an instance of.B /bin/login.This is one way to log off, included for compatibility with.MS sh 1 ..HP 5.B logout.NXR "logout command (csh)".brTerminate a login shell.Especially useful if.I ignoreeofis set..HP 5.B nice.NXR "nice command (csh)".br.ns.HP 5.BR nice " \+number".br.ns.HP 5.BR nice " command".br.ns.HP 5.BR nice " \+number command".brThe first form sets the.I nicefor this shell to 4.The second form sets the.I niceto the given number.The final two forms run command at priority 4 and.I numberrespectively.The super-user may specify negative niceness by using `nice \-number ...'.Command is always executed in a sub-shell, and the restrictionsplace on commands in simple.I ifstatements apply..HP 5.B nohup.NXR "nohup command (csh)".br.ns.HP 5.BR "nohup" " command".brThe first form can be used in shell scripts to cause hangups to be
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?