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

📄 csh.g

📁 早期freebsd实现
💻 G
📖 第 1 页 / 共 3 页
字号:
.\" Copyright (c) 1980, 1993.\"	The Regents of the University of California.  All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"	@(#)csh.g	8.1 (Berkeley) 6/8/93.\".SHGlossary.PPThis glossary lists the most important terms introduced in theintroduction to theshell and gives references to sections of the shelldocument for further information about them.References of the form`pr (1)'indicate that the command.I pris in the \s-2UNIX\s0 User Reference manual in section 1.You can look at an online copy of its manual page by doing.DSman 1 pr.DEReferences of the form (2.5)indicate that more information can be found in section 2.5 of thismanual..IP \&\fB.\fR 15nYour current directory has the name `.' as well as the name printedby the command.I pwd;see also.I dirs.The current directory `.' is usually the first .I component of the search path contained in the variable.I path ,thus commands which are in `.' are found first (2.2).The character `.' is also used in separating .I components of filenames(1.6).The character `.' at the beginning of a .I component of a .I pathname is treated specially and not matched by the .I "filename expansion"metacharacters `?', `*', and `[' `]' pairs (1.6)..IP \&\fB..\fREach directory has a file `..' in it which is a reference to itsparent directory.After changing into the directory with.I chdir ,i.e..DSchdir paper.DEyou can return to the parent directory by doing.DSchdir ...DEThe current directory is printed by.I pwd(2.7)..IP a.outCompilers which create executable images create them, by default, in thefile .I a.out.for historical reasons (2.3)..IP "absolute pathname".brA .I pathname which begins with a `/' is.I absolutesince it specifies the .I path of directories from the beginningof the entire directory system \- called the.I rootdirectory.  .I Pathname s which are not.I absoluteare called.I relative(see definition of.I "relative pathname" )(1.6)..IP aliasAn.I aliasspecifies a shorter or different name for a \s-2UNIX\s0command, or a transformation on a command to be performed inthe shell.The shell has a command.I aliaswhich establishes .I aliases and can print their current values.The command.I unaliasis used to remove .I aliases (2.4)..IP argumentCommands in \s-2UNIX\s0 receive a list of .I argument words.Thus the command.DSecho a b c.DEconsists of the.I "command name"`echo' and three .I argument words `a', `b' and `c'.The set of .I arguments after the.I "command name"is said to be the.I "argument list"of the command (1.1)..IP argvThe list of arguments to a command written in the shell language(a shell script or shell procedure) is stored in a variable called.I argvwithin the shell.This name is taken from the conventional name in theC programming language (3.4)..IP backgroundCommands started without waiting for them to complete are called.I backgroundcommands (2.6)..IP baseA filename is sometimes thought of as consisting of a.I basepart, before any `.' character, and an .I extension \- the part afterthe `.'.  See.I filenameand.I extension(1.6) and basename (1)..IP bgThe.I bgcommand causes a.I suspended job to continue execution in the.I background(2.6)..IP binA directory containing binaries of programs and shell scripts to beexecuted is typically called a .I bin directory.The standard system .I bin directories are `/bin' containing the mostheavily used commands and `/usr/bin' which contains most other userprograms.Programs developed at UC Berkeley live in `/usr/ucb', while locallywritten programs live in `/usr/local'.  Games are kept in the directory`/usr/games'.You can place binaries in any directory.If you wish to execute them often, the name of the directoriesshould be a .I component of the variable.I path ..IP break.I Breakis a builtin command used to exit from loops within the controlstructure of the shell (3.7)..IP breakswThe.I breakswbuiltin command is used to exit from a.I switchcontrol structure, like a.I breakexits from loops (3.7)..IP builtinA command executed directly by the shell is called a.I builtincommand.Most commands in \s-2UNIX\s0 are not built into the shell,but rather exist as files in .I bin directories.These commands are accessible because the directories in whichthey reside are named in the.I pathvariable..IP caseA.I casecommand is used as a label in a.I switchstatement in the shell's control structure, similar to that of thelanguage C.Details are given in the shell documentation `csh (1)' (3.7)..IP catThe.I catprogram catenates a list of specified files on the .I "standard output" .It is usually used to look at the contents of a single file on the terminal,to `cat a file' (1.8, 2.3)..IP cdThe.I cdcommand is used to change the .I "working directory" .With no arguments,.I cdchanges your .I "working directory" to be your.I homedirectory (2.4, 2.7)..IP chdirThe.I chdircommand is a synonym for.I cd ..I Cdis usually used because it is easier to type..IP chshThe.I chshcommand is used to change the shell which you use on \s-2UNIX\s0.By default, you use an different version of the shellwhich resides in `/bin/sh'.You can change your shell to `/bin/csh' by doing.DSchsh your-login-name /bin/csh.DEThus I would do.DSchsh bill /bin/csh.DEIt is only necessary to do this once.The next time you log in to \s-2UNIX\s0 after doing this command,you will be using.I cshrather than the shell in `/bin/sh' (1.9)..IP cmp.I Cmpis a program which compares files.It is usually used on binary files, or to see if two files are identical (3.6).For comparing text files the program.I diff ,described in `diff (1)' is used..IP commandA function performed by the system, either by the shell(a builtin .I command )or by a program residing in a file ina directory within the \s-2UNIX\s0 system, is called a.I command(1.1)..IP "command name".brWhen a command is issued, it consists of a.I "command name" ,which is the first word of the command,followed by arguments.The convention on \s-2UNIX\s0 is that the first word of acommand names the function to be performed (1.1)..IP "command substitution".brThe replacement of a command enclosed in `\`' charactersby the text output by that command is called.I "command substitution"(4.3)..IP componentA part of a.I pathnamebetween `/' characters is called a.I componentof that .I pathname .A variablewhich has multiple strings as value is said to haveseveral.I component s;each string is a.I componentof the variable..IP continueA builtin command which causes execution of the enclosing.I foreachor.I whileloop to cycle prematurely.Similar to the.I continuecommand in the programming language C (3.6)..IP control-Certain special characters, called.I controlcharacters, are produced by holding down the \s-2CONTROL\s0 keyon your terminal and simultaneously pressing another character, much likethe \s-2SHIFT\s0 key is used to produce upper case characters. Thus.I control- cis produced by holding down the \s-2CONTROL\s0 key while pressing the`c' key.  Usually \s-2UNIX\s0 prints an caret (^) followed by thecorresponding letter when you type a.I controlcharacter (e.g. `^C' for.I control- c(1.8)..IP "core\ dump"When a program terminates abnormally, the system places an imageof its current state in a file named `core'.This .I "core dump"can be examined with the system debugger `adb (1)'or `sdb (1)' in order to determine what went wrong with the program (1.8).If the shell produces a message of the form.DSIllegal instruction (core dumped).DE(where `Illegal instruction' is only one of several possiblemessages), you should report this to the author of the programor a system administrator, saving the `core' file..IP cpThe.I cp(copy) program is used to copy the contents of one file into anotherfile.It is one of the most commonly used \s-2UNIX\s0 commands (1.6)..IP cshThe name of the shellprogram that this document describes..IP \&.cshrcThe file.I \&.cshrcin your.I homedirectory is read by each shell as it begins execution.It is usually used to change the setting of the variable.I pathand to set.I aliasparameters which are to take effect globally (2.1)..IP cwdThe.I cwdvariable in the shell holds the.I "absolute pathname"of the current.I "working directory" \&.It is changed by the shell whenever your current.I "working directory"changes and should not be changed otherwise (2.2)..IP dateThe.I datecommand prints the current date and time (1.3)..IP debugging.I Debuggingis the process of correcting mistakes in programs and shell scripts.The shell has several options and variables which may be usedto aid in shell .I debugging (4.4)..IP default:The label.I default:is used within shell.I switchstatements, as it is in the C languageto label the code to be executed if none of the.I caselabels matches the value switched on (3.7)..IP \s-2DELETE\s0The\s-2DELETE\s0or\s-2RUBOUT\s0key on the terminal normally causes an interrupt to be sent to the current job.Many users change the interrupt character to be ^C..IP detachedA command that continues running in the .I background after you logout is said to be .I detached ..IP diagnosticAn error message produced by a program is often referred to as a.I diagnostic .Most error messages are not written to the .I "standard output" ,since that is often directed away from the terminal (1.3, 1.5).Error messsages are instead written to the.I "diagnostic output"which may be directed away from the terminal, but usually is not.Thus .I diagnostics will usually appear on the terminal (2.5)..IP directoryA structure which contains files.At any time you are in one particular .I directory whose names can be printed by the command .I pwd .The.I chdircommand will change you to another .I directory , and make the filesin that .I directory visible. The .I directory in which you are when you first login is your.I homedirectory (1.1, 2.7)..IP "directory\ stack"The shell saves the names of previous.I "working directories"in the.I "directory stack"when you change your current.I "working directory"via the.I pushdcommand.  The.I "directory stack"can be printed by using the.I dirscommand, which includes your current.I "working directory"as the first directory name on the left (2.7)..IP dirsThe.I dirscommand prints the shell's.I "directory stack" (2.7)..IP duThe.I ducommand is a program (described in `du (1)') whichprints the number of disk blocks is all directories belowand including your current.I "working directory"(2.6)..IP echoThe.I echocommand prints its arguments (1.6, 3.6)..IP elseThe.I elsecommand is part of the `if-then-else-endif' controlcommand construct (3.6)..IP endifIf an.I ifstatement is ended with the word.I then ,all lines following the.I ifup to a line starting with the word.I endifor.I elseare executed if the condition between parentheses after the.I ifis true (3.6)..IP \s-2EOF\s0An.I "end\f1-\fPof\f1-\fPfile"is generated by the terminal by a control-d,and whenever a command reads to the end of a file whichit has been given as input.Commands receiving input from a.I pipereceive an .I "end\f1-\fPof\f1-\fPfile" when the command sending them input completes.Most commands terminate when they receive an .I "end\f1-\fPof\f1-\fPfile" .The shell has an option to ignore .I "end\f1-\fPof\f1-\fPfile" from a terminalinput which may help you keep from logging out accidentallyby typing too many control-d's (1.1, 1.8, 3.8)..IP escapeA character `\e' used to prevent the special meaning of a metacharacteris said to.I escapethe character from its special meaning.Thus.DSecho \e*.DEwill echo the character `*' while just.DSecho *.DEwill echo the names of the file in the current directory.In this example, \e.I escape s`*' (1.7).There is also a non-printing character called.I escape , usually labelled\s-2ESC\s0or\s-2ALTMODE\s0on terminal keyboards.Some older \s-2UNIX\s0 systems use this character to indicate thatoutput is to be .I suspended . Most systems use control-s to stop the output and control-q to start it..IP /etc/passwdThis file contains information about the accounts currently on thesystem.It consists of a line for each account with fields separated by`:' characters (1.8).You can look at this file by saying.DScat /etc/passwd.DEThe commands.I fingerand.I grepare often used to search for information in this file.See `finger (1)', `passwd(5)', and `grep (1)' for more details..IP exitThe.I exitcommand is used to force termination of a shell script,and is built into the shell (3.9)..IP "exit\ status"A command which discovers a problem may reflect this back to the command(such as a shell) which invoked (executed) it.It does this by returning a non-zero number as its

⌨️ 快捷键说明

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