⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csh.1

📁 早期freebsd实现
💻 1
📖 第 1 页 / 共 5 页
字号:
.Ar commandwith arguments is executed.Variable substitution on.Ar commandhappens early, at the sametime it does for the rest of the.Ic ifcommand..Ar Commandmust be a simple command, nota pipeline, a command list, or a parenthesized command list.Input/output redirection occurs even if.Ar expris false, i.e., when command is.Sy notexecuted (this is a bug)..Pp.It Ic if ( Ar expr ) Ic then.It ....It Ic else if ( Ar expr2 ) Ic then.It ....It Ic else.It ....It Ic endifIf the specified.Ar expris true then the commands up to the first.Ic elseare executed; otherwise if.Ar expr2is true then the commands up to thesecond.Ic elseare executed, etc.Any number of.Ic else-ifpairs are possible; only one.Ic endifis needed.The.Ic elsepart is likewise optional.(The words.Ic elseand.Ic endifmust appear at the beginning of input lines;the.Ic ifmust appear alone on its input line or after an.Ic else . ).Pp.It Ic jobs.It Ic jobs Fl lLists the active jobs; the.Fl loption lists process id's in addition to the normal information..Pp.It Ic kill % Ns Ar job.It Ic kill Ar pid.It Ic kill Fl sig Ar pid ....It Ic kill Fl lSends 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.Pa /usr/include/signal.h,stripped of the prefix ``SIG'').The signal names are listed by ``kill \-l''.There is no default, just saying `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..Pp.It Ic limit.It Ic limit Ar resource.It Ic limit Ar resource maximum-use.It Ic limit Fl h.It Ic limit Fl h Ar resource.It Ic limit Fl h Ar resource maximum-useLimits the consumption by the current process and each processit creates to not individually exceed.Ar maximum-useon thespecified.Ar resource  .If no.Ar maximum-useis given, thenthe current limit is printed; if no.Ar resourceis given, thenall limitations are given.  If the.Fl hflag is given, the hard limits are used instead of the currentlimits.  The hard limits impose a ceiling on the values ofthe current limits.  Only the super-user may raise the hard limits,but a user may lower or raise the current limits within the legal range..PpResources controllable currently include.Ar cputime(the maximumnumber of cpu-seconds to be used by each process),.Ar filesize(the largest single file that can be created),.Ar datasize(the maximum growth of the data+stack region via.Xr sbrk  2beyond the end of the program text),.Ar stacksize(the maximumsize of the automatically-extended stack region), and.Ar coredumpsize(the size of the largest core dump that will be created)..PpThe.Ar maximum-usemay be given as a (floating point or integer)number followed by a scale factor.  For all limits other than.Ar cputimethe default scale is `k' or `kilobytes' (1024 bytes);a scale factor of `m' or `megabytes' may also be used.For.Ar cputimethe default scale is `seconds';a scale factor of `m' for minutesor `h' for hours, or a time of the form `mm:ss' giving minutesand seconds also may be used..PpFor both.Ar resourcenames and scale factors, unambiguous prefixesof the names suffice..Pp.It Ic loginTerminate a login shell, replacing it with an instance of.Pa /bin/login.This is one way to log off, included for compatibility with.Xr sh  1  ..Pp.It Ic logoutTerminate a login shell.Especially useful if.Ic ignoreeofis set..Pp.It Ic nice.It Ic nice Ar +number.It Ic nice Ar command.It Ic nice Ar +number commandThe first form sets thescheduling priorityfor this shell to 4.The second form sets thepriorityto the given.Ar number .The final two forms run command at priority 4 and.Ar numberrespectively.The greater the number, the less cpu the process will get.The super-user may specify negative priority by using `nice \-number ...'..Ar Commandis always executed in a sub-shell, and the restrictionsplaced on commands in simple.Ic ifstatements apply..Pp.It Ic nohup.It Ic nohup Ar commandThe first form can be used in shell scripts to cause hangups to beignored for the remainder of the script.The second form causes the specified command to be run with hangupsignored.All processes detached with `&' are effectively.Ic nohup Ns \'ed ..Pp.It Ic notify.It Ic notify % Ns Ar job ...Causes the shell to notify the user asynchronously when the status of thecurrent or specified jobs change; normally notification is presentedbefore a prompt.  This is automatic if the shell variable.Ic notifyis set..Pp.It Ic onintr.It Ic onintr Fl.It Ic onintr Ar labelControl 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..PpIn any case, if the shell is running detached and interrupts arebeing ignored, all forms of.Ic onintrhave no meaning and interruptscontinue to be ignored by the shell and all invoked commands.Finally.Ic onintr statements are ignored in the system startup files where interruptsare disabled (/etc/csh.cshrc, /etc/csh.login)..Pp.It Ic popd.It Ic popd Ar +nPops the directory stack, returning to the new top directory.With an argument.Ns \`+ Ar n Ns \'discards the.Ar n Ns \'thentry in the stack.The members of the directory stack are numbered from the top starting at 0..Pp.It Ic pushd.It Ic pushd Ar name.It Ic pushd Ar nWith no arguments,.Ic pushdexchanges the top two elements of the directory stack.Given a.Ar nameargument,.Ic pushdchanges to the new directory (ala.Ic cd )and pushes the old current working directory(as in.Ic csw )onto the directory stack.With a numeric argument,.Ic pushdrotates the.Ar n Ns \'thargument 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..Pp.It Ic rehashCauses the internal hash table of the contents of the directories inthe.Ic pathvariable to be recomputed.  This is needed if new commands are addedto directories in the.Ic 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 a system directory..Pp.It Ic repeat Ar count commandThe specified.Ar commandwhich is subject to the same restrictionsas the.Ar commandin the one line.Ic ifstatement above,is executed.Ar counttimes.I/O redirections occur exactly once, even if.Ar countis 0..Pp.It Ic set.It Ic set Ar name.It Ic set Ar name Ns =word.It Ic set Ar name[index] Ns =word.It Ic set Ar name Ns =(wordlist)The first form of the command shows the value of all shell variables.Variables that have other than a single word as theirvalue print as a parenthesized word list.The second form sets.Ar nameto the null string.The third form sets.Ar nameto the single.Ar word .The fourth form setsthe.Ar index Ns 'thcomponent of.Ar nameto.Ar word ;this component must already exist.The final form sets.Ar nameto the list of words in.Ar wordlist .The value is always command and filename expanded..PpThese 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..Pp.It Ic setenv.It Ic setenv Ar name.It Ic setenv Ar name valueThe first form lists all current environment variables.It is equivalent to.Xr printenv 1 .The last form sets the value of environment variable.Ar nameto be.Ar value ,a single string.  The second form sets.Ar nameto an empty string.The most commonly used environment variables.Ev USER ,.Ev TERM ,and.Ev PATHare automatically imported to and exported from the.Nm cshvariables.Ar user ,.Ar term ,and.Ar path ;there is no need to use.Ic setenvfor these..Pp.It Ic shift.It Ic shift Ar variableThe members of.Ic argvare shifted to the left, discarding.Ic argv Ns Bq 1 .It is an error for.Ic argvnot to be set or to have less than one word as value.The second form performs the same function on the specified variable..Pp.It Ic source Ar name.It Ic source Fl h Ar nameThe shell reads commands from.Ar name ..Ic Sourcecommands may be nested; if they are nested too deeply the shell mayrun out of file descriptors.An error in a.Ic sourceat any level terminates all nested.Ic sourcecommands.Normally input during.Ic sourcecommands is not placed on the history list;the \-h option causes the commands to be placed on thehistory list without being executed..Pp.It Ic stop.It Ic stop % Ns Ar job ...Stops the current or specified jobs that are executing in the background..Pp.It Ic suspendCauses the shell to stop in its tracks, much as if it had been sent a stopsignal with.Ic ^Z .This is most often used to stop shells started by.Xr su  1 ..Pp.It Ic switch Ar (string).It Ic case Ar str1 :.It \ \ \ \ \&....It Ic \ \ \ \ breaksw.It \ \ \ \ \&....It Ic default :.It \ \ \ \ \&....It Ic \ \ \ \ breaksw.It Ic endswEach case label is successively matched against the specified.Ar stringwhich is first command and filename expanded.The file metacharacters `*', `?' and `[...]'may be used in the case labels,which are variable expanded.If none of the labels match before the `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.Ic breakswcauses execution to continue after the.Ic endsw .Otherwise control may fall through case labels and the default label as in C.If no label matches and there is no default, execution continues afterthe.Ic endsw ..Pp.It Ic time.It Ic time Ar commandWith 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.Ic timevariable is printed.  If necessary, an extra shell is created to print the timestatistic when the command completes..Pp.It Ic umask.It Ic umask Ar valueThe 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 write access forusers in the group or others..Pp.It Ic unalias Ar patternAll 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.Ic unaliased ..Pp

⌨️ 快捷键说明

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