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

📄 csh.1

📁 早期freebsd实现
💻 1
📖 第 1 页 / 共 5 页
字号:
.It Ic unhashUse of the internal hash table to speed location of executed programsis disabled..Pp.It Ic unlimit.It Ic unlimit Ar  resource.It Ic unlimit Fl h.It Ic unlimit Fl h Ar resourceRemoves the limitation on.Ar resource  .If no.Ar resourceis specified, then all.Ar resourcelimitations are removed.  If.Fl his given, the corresponding hard limits are removed.  Only thesuper-user may do this..Pp.It Ic unset Ar patternAll 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.Ic unset ..Pp.It Ic unsetenv Ar patternRemoves all variables whose name match the specified pattern from theenvironment.  See also the.Ic setenvcommand above and.Xr printenv  1  ..Pp.It Ic waitWait for all background jobs.If the shell is interactive, then an interrupt can disrupt the wait.After the interrupt, the shell prints names and job numbers of all jobsknown to be outstanding..It Ic which Ar commandDisplays the resolved command that will be executed by the shell..Pp.It Ic while Ar (expr).It \&....It Ic endWhile the specified expression evaluates non-zero, the commands betweenthe.Ic whileand the matching.Ic endare evaluated..Ic Breakand.Ic continuemay be used to terminate or continue the loop prematurely.(The.Ic whileand.Ic endmust appear alone on their input lines.)Prompting occurs here the first time through the loop as for the.Ic foreachstatement if the input is a terminal..Pp.It Ic % Ns Ar jobBrings the specified job into the foreground..Pp.It Ic % Ns Ar job Ic &Continues the specified job in the background..Pp.It Ic @.It Ic @ Ns Ar name Ns = expr.It Ic @ Ns Ar name[index] Ns = exprThe first form prints the values of all the shell variables.The second form sets the specified.Ar nameto the value of.Ar expr .If the expression contains `<', `>', `&' or `|' then at leastthis part of the expression must be placed within `(' `)'.The third form assigns the value of.Ar exprto the.Ar index Ns 'thargument of.Ar name .Both.Ar nameand its.Ar index Ns 'thcomponent must already exist..El.PpThe 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.Ar exprwhich would otherwise be single words..PpSpecial postfix `+\|+' and `\-\|\-' operators increment and decrement.Ar namerespectively, i.e., `@  i++'..Ss Pre-defined and environment variablesThe following variables have special meaning to the shell.Of these,.Ar argv ,.Ar cwd,.Ar home ,.Ar path,.Ar prompt ,.Ar shelland.Ar statusare always set by the shell.Except for.Ar cwdand.Ar status ,this setting occurs only at initialization;these variables will not then be modified unless doneexplicitly by the user..PpThe shell copies the environment variable.Ev USERinto the variable.Ar user ,.Ev TERMinto.Ar term ,and.Ev HOMEinto.Ar home ,and copies these back into the environment whenever the normalshell variables are reset.The environment variable.Ev PATHis likewise handled; it is notnecessary to worry about its setting other than in the file.Ar \&.cshrcas inferior.Nm cshprocesses will import the definition of.Ar pathfrom the environment, and re-export it if you then change it..Bl -tag -width histchars.It Ic argvSet to the arguments to the shell, it is from this variable thatpositional parameters are substituted, i.e., `$1' is replaced by`$argv[1]',etc..It Ic cdpathGives a list of alternate directories searched to find subdirectoriesin.Ar chdircommands..It Ic cwdThe full pathname of the current directory..It Ic echoSet when the.Fl xcommand line option is given.Causes each command and its argumentsto be echoed just before it is executed.For non-builtin commands all expansions occur before echoing.Builtin commands are echoed before command and filename substitution,since these substitutions are then done selectively..It Ic filecEnable file name completion..It Ic histcharsCan be given a string value to change the characters used in historysubstitution.  The first character of its value is used as thehistory substitution character, replacing the default character `!'.The second character of its value replaces the character `\(ua' inquick substitutions..It Ic histfileCan be set to the pathname where history is going to be saved/restored..It Ic historyCan be given a numeric value to control the size of the history list.Any command that has been referenced in this many events will not bediscarded.Too large values of.Ar historymay run the shell out of memory.The last executed command is always saved on the history list..It Ic homeThe home directory of the invoker, initialized from the environment.The filename expansion of.Sq Pa ~refers to this variable..It Ic ignoreeofIf set the shell ignoresend-of-file from input devices which are terminals.This prevents shells from accidentally being killed by control-D's..It Ic mailThe files where the shell checks for mail.This checking is done after each command completion that willresult in a prompt,if a specified interval has elapsed.The shell says `You have new mail.'if the file exists with an access time not greater than its modify time..PpIf the first word of the value of.Ar mailis numeric it specifies a different mail checking interval, in seconds,than the default, which is 10 minutes..PpIf multiple mail files are specified, then the shell says`New mail in.Ar name Ns 'when there is mail in the file.Ar name ..It Ic noclobberAs described in the section on.Sx input/output ,restrictions are placed on output redirection to insure thatfiles are not accidentally destroyed, and that `>>' redirectionsrefer to existing files..It Ic noglobIf set, filename expansion is inhibited.This inhibition is most useful in shell scripts that are not dealing with filenames,or after a list of filenames has been obtained and further expansionsare not desirable..It Ic nonomatchIf set, it is not an error for a filename expansion to not match anyexisting files; instead the primitive pattern is returned.It is still an error for the primitive pattern to be malformed, i.e.,`echo ['still gives an error..It Ic notifyIf set, the shell notifies asynchronously of job completions;the default is to present job completions just before printinga prompt..It Ic pathEach word of the path variable specifies a directory in whichcommands are to be sought for execution.A null word specifies the current directory.If there is no.Ar pathvariable then only full path names will execute.The usual search path is `.', `/bin' and `/usr/bin', but thismay vary from system to system.For the super-user the default search path is `/etc', `/bin' and `/usr/bin'.A shell that is given neither the.Fl cnor the.Fl toption will normally hash the contents of the directories in the.Ar pathvariable after reading.Ar \&.cshrc ,and each time the.Ar pathvariable is reset.  If new commands are added to these directorieswhile the shell is active, it may be necessary to do a.Ic rehashor the commands may not be found..It Ic promptThe string that is printed before each command is read froman interactive terminal input.If a `!' appears in the string it will be replaced by the current event numberunless a preceding `\e' is given.Default is `% ', or `# ' for the super-user..It Ic savehistIs given a numeric value to control the number of entries of thehistory list that are saved in ~/.history when the user logs out.Any command that has been referenced in this many events will be saved.During start up the shell sources ~/.history into the history listenabling history to be saved across logins.Too large values of.Ar savehistwill slow down the shell during start up.If.Ar savehistis just set, the shell will use the value of.Ar history..It Ic shellThe file in which the shell resides.This variable is used in forking shells to interpret files that have executebits set, but which are not executable by the system.(See the description of.Sx Non-builtin Command Executionbelow.)Initialized to the (system-dependent) home of the shell..It Ic statusThe status returned by the last command.If it terminated abnormally, then 0200 is added to the status.Builtin commands that fail return exit status `1',all other builtin commands set status to `0'..It Ic timeControls automatic timing of commands.If set, then any command that takes more than this many cpu secondswill cause a line giving user, system, and real times and a utilizationpercentage which is the ratio of user plus system times to real timeto be printed when it terminates..It Ic verboseSet by the.Fl vcommand line option, causes the words of each command to be printedafter history substitution..El.Ss Non-builtin command executionWhen a command to be executed is found to not be a builtin commandthe shell attempts to execute the command via.Xr execve  2  .Each word in the variable.Ar pathnames a directory from which the shell will attempt to execute the command.If it is given neither a.Fl cnor a.Fl toption, the shell will hash the names in these directories into an internaltable so that it will only try an.Ic execin a directory if there is a possibility that the command resides there.This shortcut greatly speeds command location when many directoriesare present in the search path.If this mechanism has been turned off (via.Ic unhash ) ,or if the shell was given a.Fl cor.Fl targument, and in any case for each directory component of.Ar paththat does not begin with a `/',the shell concatenates with the given command name to form a path nameof a file which it then attempts to execute..PpParenthesized commands are always executed in a subshell.Thus.Pp.Dl (cd ; pwd) ; pwd.Ppprints the.Ar homedirectory; leaving you where you were (printing this after the home directory),while.Pp.Dl cd ; pwd.Ppleaves you in the.Ar homedirectory.Parenthesized commands are most often used to prevent.Ic chdirfrom affecting the current shell..PpIf the file has execute permissions but is not anexecutable binary to the system, then it is assumed to be afile containing shell commands and a new shell is spawned to read it..PpIf there is an.Ic aliasfor.Ic shellthen the words of the alias will be prepended to the argument list to formthe shell command.The first word of the.Ic aliasshould be the full path name of the shell(e.g., `$shell').Note that this is a special, late occurring, case of.Ic aliassubstitution,and only allows words to be prepended to the argument list without change..Ss Signal handlingThe shell normally ignores.Ar quitsignals.Jobs running detached (either by.Ic \&&or the.Ic bgor.Ic %... &commands) are immune to signals generated from the keyboard, includinghangups.Other signals have the values which the shell inherited from its parent.The shell's handling of interrupts and terminate signalsin shell scripts can be controlled by.Ic onintr .Login shells catch the.Ar terminatesignal; otherwise this signal is passed on to children from the state in theshell's parent.Interrupts are not allowed when a login shell is reading the file.Pa \&.logout ..Sh AUTHORWilliam Joy.Job control and directory stack features first implemented by J.E. Kulp ofIIASA, Laxenburg, Austria,with different syntax than that used now.File name completion code written by Ken Greer, HP Labs.Eight-bit implementation Christos S. Zoulas, Cornell University..Sh FILES.Bl -tag -width /etc/passwd -compact.It Pa ~/.cshrcRead at beginning of execution by each shell..It Pa ~/.loginRead by login shell, after `.cshrc' at login..It Pa ~/.logoutRead by login shell, at logout..It Pa /bin/shStandard shell, for shell scripts not starting with a `#'..It Pa /tmp/sh*Temporary file for `<<'..It Pa /etc/passwdSource of home directories for `~name'..El.Sh LIMITATIONSWord lengths \-Words can be no longer than 1024 characters.The system limits argument lists to 10240 characters.The number of arguments to a command that involves filename expansionis limited to 1/6'th the number of character

⌨️ 快捷键说明

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