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

📄 csh.g

📁 早期freebsd实现
💻 G
📖 第 1 页 / 共 3 页
字号:
.I "exit status" ,a status of zero being considered`normal termination'.The.I exitcommand can be used to force a shell command script to give a non-zero.I "exit status" (3.6)..IP expansionThe replacement of strings in the shell input which contain metacharactersby other strings is referred to as the process of.I expansion .Thus the replacement of the word `*' by a sorted list of filesin the current directory is a `filename expansion'.Similarly the replacement of the characters `!!' by the text ofthe last command is a `history expansion'..I Expansions are also referred to as.I substitutions(1.6, 3.4, 4.2)..IP expressions.I Expressions are used in the shellto control the conditional structures used in the writing of shellscripts and in calculating values for these scripts.The operators available in shell .I expressions are those of the languageC (3.5)..IP extensionFilenames often consist of a.I basename and an.I extensionseparated by the character `.'.By convention, groups of related files often share the same .I root name.Thus if `prog.c' were a C program, then the object file for thisprogram would be stored in `prog.o'.Similarly a paper written with the`\-me'nroff macro package might be stored in`paper.me'while a formatted version of this paper might be kept in`paper.out' and a list of spelling errors in`paper.errs' (1.6)..IP fgThe.I "job control"command.I fgis used to run a.I backgroundor.I suspendedjob in the.I foreground(1.8, 2.6)..IP filenameEach file in \s-2UNIX\s0 has a name consisting of up to 14 charactersand not including the character `/' which is used in.I pathnamebuilding.  Most .I filenamesdo not begin with the character `.', and contain only letters and digits with perhaps a `.' separating the.I baseportion of the .I filename from an .I extension (1.6)..IP "filename expansion".br.I "Filename expansion" uses the metacharacters `*', `?' and `[' and `]'to provide a convenient mechanism for naming files.Using .I "filename expansion" it is easy to name all the files inthe current directory, or all files which have a common .I root name. Other .I "filename expansion" mechanisms use the metacharacter `~' and allowfiles in other users' directories to be named easily (1.6, 4.2)..IP flagMany \s-2UNIX\s0 commands accept arguments which are not the namesof files or other users but are used to modify the action of the commands.These are referred to as.I flagoptions, and by convention consist of one or more letters preceded bythe character `\-' (1.2).Thus the.I ls(list files) command has an option`\-s' to list the sizes of files.This is specified.DSls \-s.DE.IP foreachThe.I foreachcommand is used in shell scripts and at the terminal to specifyrepetition of a sequence of commands while the value of a certainshell variable ranges through a specified list (3.6, 4.1)..IP foregroundWhen commands are executing in the normal way such that theshell is waiting for them to finish before prompting for anothercommand they are said to be.I "foreground jobs"or.I "running in the foreground" \&.  This is as opposed to.I background ..I Foregroundjobs can be stopped by signalsfrom the terminal caused by typing differentcontrol characters at the keyboard (1.8, 2.6)..IP gotoThe shell has a command.I gotoused in shell scripts to transfer control to a given label (3.7)..IP grepThe.I grepcommand searches through a list of argument files for a specified string.Thus.DSgrep bill /etc/passwd.DEwill print each line in the file.I "/etc/passwd"which contains the string `bill'.Actually,.I grepscans for .I "regular expressions"in the sense of the editors`ed (1)' and `ex (1)'..I Grepstands for`globally find .I "regular expression" and print' (2.4)..IP headThe.I headcommand prints the first few lines of one or more files.If you have a bunch of files containing text which you are wonderingabout it is sometimes useful to run.I headwith these files as arguments.This will usually show enough of what is in these files to let you decidewhich you are interested in (1.5)..br.I Headis also used to describe the part of a.I pathnamebefore and including the last `/' character.  The.I tailof a.I pathnameis the part after the last `/'.  The `:h' and `:t' modifiers allow the.I heador.I tailof a .I pathname stored in a shell variable to be used (3.6)..IP historyThe.I historymechanism of the shell allows previous commands to be repeated,possibly after modification to correct typing mistakes or to changethe meaning of the command.The shell has a.I "history list"where these commands are kept, and a.I historyvariable which controls how large this list is (2.3)..IP "home\ directory".brEach user has a .I "home directory" ,which is given in your entryin the password file,.I /etc/passwd .This is the directory which you are placed in when you first login.The.I cdor.I chdircommand with no arguments takes you back to this directory, whosename is recorded in the shell variable.I home .You can also access the .I "home directories" of other users in formingfilenames using a .I "filename expansion" notation and the character `~' (1.6)..IP ifA conditional command within the shell, the.I ifcommand is used in shell command scripts to make decisionsabout what course of action to take next (3.6)..IP ignoreeofNormally, your shell will exit, printing`logout'if you type a control-d at a prompt of `% '.This is the way you usually log off the system.You can.I setthe.I ignoreeofvariable if you wish in your.I \&.loginfile and then use the command.I logoutto logout.This is useful if you sometimes accidentally type too many control-dcharacters, logging yourself off(2.2)..IP inputMany commands on \s-2UNIX\s0 take information from the terminal or fromfiles which they then act on.This information is called.I input .Commands normally read for .I input from their.I "standard input"which is, by default, the terminal.This .I "standard input" can be redirected from a file using a shell metanotationwith the character `<'.Many commands will also read from a file specified as argument.Commands placed in .I pipelineswill read from the output of the previouscommand in the .I pipeline .The leftmost command in a .I pipeline reads from the terminal ifyou neither redirect its .I input nor give it a filename to use as.I "standard input" .Special mechanisms exist for supplying input to commands in shellscripts (1.5, 3.8)..IP interruptAn.I interruptis a signal to a program that is generated by typing ^C. (On older versionsof UNIX the \s-2RUBOUT\s0 or \s-2DELETE\s0 key were used for this purpose.)It causes most programs to stop execution.Certain programs, such as the shell and the editors,handle an .I interrupt in special ways, usually by stopping what theyare doing and prompting for another command.While the shell is executing another command and waiting for itto finish, the shell does not listen to .I interrupts.The shell often wakes up when you hit .I interrupt because many commandsdie when they receive an .I interrupt (1.8, 3.9)..IP jobOne or more commandstyped on the same input line separated by `|' or `;' charactersare run together and are called a.I job \&.Simple commands run by themselves without any `|' or `;' charactersare the simplest .I jobs..I Jobsare classified as.I foreground ,.I background ,or.I suspended(2.6)..IP "job\ control"The builtin functions that control the execution ofjobs are called.I "job control"commands.  These are.I "bg, fg, stop, kill"(2.6)..IP "job\ number"When each jobis started it is assigned a small number called a.I "job number"which is printed next to the job in the output of the.I jobscommand.  This number, preceded by a `%' character, can be used as an argumentto.I "job control"commands to indicatea specific job (2.6)..IP jobsThe.I jobscommand prints a table showingjobs that are either running in the.I backgroundor are.I suspended(2.6)..IP killA command which sends asignalto a job causing it to terminate (2.6)..IP \&.loginThe file.I \&.loginin your.I homedirectory is read by the shell each time you login to \s-2UNIX\s0and the commands there are executed.There are a number of commands which are usefully placed here,especially.I setcommands to the shell itself (2.1)..IP "login\ shell"The shell that is started on your terminal when you login is calledyour.I "login shell" .It is different from other shells which you may run (e.g. onshell scripts)in that it reads the.I \&.loginfile before reading commands from the terminal and it reads the.I \&.logoutfile after you logout(2.1)..IP logoutThe.I logoutcommand causes a login shell to exit.Normally, a login shell will exit when you hit control-dgenerating an .I end\f1-\fPof\f1-\fPfile, but if you have set.I ignoreeofin you.I \&.loginfile then this will not work and you must use.I logoutto log off the \s-2UNIX\s0 system (2.8)..IP \&.logoutWhen you log off of \s-2UNIX\s0 the shell will execute commands fromthe file.I \&.logoutin your.I homedirectory after it prints `logout'..IP lprThe command.I lpris the line printer daemon.The standard input of.I lprspooled and printed on the \s-2UNIX\s0 line printer.You can also give.I lpra list of filenames as arguments to be printed.It is most common to use.I lpras the last component of a.I pipeline(2.3)..IP lsThe.I ls(list files) command is one of the most commonly used \s-2UNIX\s0commands.With no argument filenames it prints the names of the files in thecurrent directory.It has a number of useful.I flagarguments, and can also be given the names of directoriesas arguments, in which case it lists the names of the files in thesedirectories (1.2)..IP mailThe.I mailprogram is used to send and receive messages from other \s-2UNIX\s0users (1.1, 2.1), whether they are logged on or not..IP makeThe.I makecommand is used to maintain one or more related files and toorganize functions to be performed on these files. In many ways.I makeis easier to use, and more helpful thanshell command scripts (3.2)..IP makefileThe file containing commands for.I makeis called.I makefile or .I Makefile(3.2)..IP manualThe .I manual often referred to is the`\s-2UNIX\s0 manual'.It contains 8 numbered sections with a description of each \s-2UNIX\s0program (section 1), system call (section 2), subroutine (section 3),device (section 4), special data structure (section 5), game (section 6),miscellaneous item (section 7) and system administration program (section 8).There are also supplementary documents (tutorials and reference guides)for individual programs which require explanation in more detail.An online version of the .I manual is accessible through the.I mancommand.Its documentation can be obtained online via.DSman man.DEIf you can't decide what manual page to look in, try the .I apropos (1)command.The supplementary documents are in subdirectories of /usr/doc..IP metacharacter.brMany characters which are neither letters nor digits have special meaningeither to the shell or to \s-2UNIX\s0.These characters are called.I metacharacters .If it is necessary to place these characters in arguments to commandswithout them having their special meaning then they must be.I quoted .An example of a .I metacharacter is the character `>' which is usedto indicate placement of output into a file.For the purposes of the.I historymechanism,most unquoted .I metacharactersform separate words (1.4).The appendix to this user's manual lists the .I metacharactersin groups by their function..IP mkdirThe.I mkdircommand is used to create a new directory..IP modifierSubstitutions with the .I history mechanism, keyed by the character `!'or of variables using the metacharacter `$', are often subjectedto modifications, indicated by placing the character `:' after thesubstitution and following this with the .I modifier itself.The.I "command substitution"mechanism can also be used to perform modification in a similar way,but this notation is less clear (3.6)..IP moreThe program.I morewrites a file on your terminal allowing you to control how much textis displayed at a time..I Morecan move through the file screenful by screenful, line by line,search forward for a string, or start again at the beginning of the file.It is generally the easiest way of viewing a file (1.8)..IP noclobberThe shell has a variable.I noclobberwhich may be set in the file.I \&.loginto prevent accidental destruction of files by the `>' output redirectionmetasyntax of the shell (2.2, 2.5)..IP noglobThe shell variable.I noglobis set to suppress the.I "filename expansion"of arguments containing the metacharacters `~', `*', `?', `[' and `]' (3.6)..IP notifyThe.I notifycommand tells the shell to report on the termination of a specific.I "background job"at the exact time it occurs as opposed to waitinguntil just before the next prompt to report the termination.The.I notifyvariable, if set, causes the shell to always report the terminationof.I background jobs exactly when they occur (2.6)..IP onintrThe.I onintrcommand is built into the shell and is used to control the actionof a shell command script when an .I interrupt signal is received (3.9)..IP outputMany commands in \s-2UNIX\s0 result in some lines of text which arecalled their.I output.This .I output is usually placed on what is known as the.I "standard output"which is normally connected to the user's terminal.The shell has a syntax using the metacharacter `>' for redirectingthe .I "standard output" of a command to a file (1.3).Using the.I pipemechanism and the metacharacter `|' it is also possible forthe .I "standard output" of one command to become the .I "standard input" of another command (1.5).Certain commands such as the line printer daemon.I pdo not place their results on the .I "standard output" but rather in moreuseful places such as on the line printer (2.3).Similarly the.I writecommand places its output on another user's terminal rather than its.I "standard output" (2.3).Commands also have a.I "diagnostic output"where they write their error messages.Normally these go to the terminal even if the .I "standard output" has been sent to a file or another command, but it is possibleto direct error diagnostics along with .I "standard output" using a special metanotation (2.5)..IP pathThe shell has a variable.I pathwhich gives the names of the directories in which it searches forthe commands which it is given.It always checks first to see if the command it is given isbuilt into the shell.If it is, then it need not search for the command as it can do it internally.If the command is not builtin, then the shell searches for a filewith the name given in each of the directories in the.I pathvariable, left to right.Since the normal definition of the.I path

⌨️ 快捷键说明

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