UNIX Reference Manual (794271)
Текст из файла
CSH ( 1 )UNIX Reference ManualCSH ( 1 )NAMEcsh − a shell (command interpreter) with C-like syntaxSYNOPSIScsh [ −bcefinstvVxX] [arg ... ]csh [ −l]DESCRIPTIONThe csh is a command language interpreter incorporating a history mechanism (see HistorySubstitutions), job control facilities (see Jobs), interactive file name and user name completion (seeFile Name Completion), and a C-like syntax. It is used both as an interactive login shell and a shellscript command processor.Argument list processingIf the first argument (argument 0) to the shell is ‘ −’, then this is a login shell. A login shell also can be specified by invoking the shell with the ‘ −l’ flag as the only argument.The rest of the flag arguments are interpreted as follows:−bThis flag forces a ‘‘break’’ from option processing, causing any further shell arguments to be treatedas non-option arguments.
The remaining arguments will not be interpreted as shell options. Thismay be used to pass options to a shell script without confusion or possible subterfuge. The shell willnot run a set-user ID script without this option.−cCommands are read from the (single) following argument which must be present. Any remaining arguments are placed in argv.−eThe shell exits if any invoked command terminates abnormally or yields a non-zero exit status.−fThe shell will start faster, because it will neither search for nor execute commands from the file.cshrc in the invoker’s home directory.−iThe shell is interactive and prompts for its top-level input, even if it appears not to be a terminal.Shells are interactive without this option if their inputs and outputs are terminals.−lThe shell is a login shell (only applicable if −l is the only flag specified).−nCommands are parsed, but not executed.
This aids in syntactic checking of shell scripts.−sCommand input is taken from the standard input.−tA single line of input is read and executed. A ‘\’ may be used to escape the newline at the end ofthis line and continue onto another line.−vCauses the verbose variable to be set, with the effect that command input is echoed after historysubstitution.−xCauses the echo variable to be set, so that commands are echoed immediately before execution.−VCauses the verbose variable to be set even before .cshrc is executed.−XIs to −x as −V is to −v.After processing of flag arguments, if arguments remain but none of the −c, −i, −s, or −t options weregiven, the first argument is taken as the name of a file of commands to be executed. The shell opens this file,and saves its name for possible resubstitution by ‘$0’.
Since many systems use either the standard version 6or version 7 shells whose shell scripts are not compatible with this shell, the shell will execute such a ‘standard’ shell if the first character of a script is not a ‘#’, i.e., if the script does not start with a comment. Re-4th Berkeley DistributionJanuary 21, 19941CSH ( 1 )UNIX Reference ManualCSH ( 1 )maining arguments initialize the variable argv.An instance of csh begins by executing commands from the file /etc/csh.cshrc and, if this is a loginshell, /etc/csh.login. It then executes commands from .cshrc in the home directory of the invoker,and, if this is a login shell, the file .login in the same location.
It is typical for users on crt’s to put thecommand ‘‘stty crt’’ in their .login file, and to also invoke tset(1) there.In the normal case, the shell will begin reading commands from the terminal, prompting with ‘% ’. Processing of arguments and the use of the shell to process files containing command scripts will be described later.The shell repeatedly performs the following actions: a line of command input is read and broken intowords. This sequence of words is placed on the command history list and parsed.
Finally each command inthe current line is executed.When a login shell terminates it executes commands from the files .logout in the user’s home directoryand /etc/csh.logout.Lexical structureThe shell splits input lines into words at blanks and tabs with the following exceptions.
The characters ‘&’‘|’ ‘;’ ‘<’ ‘>’ ‘(’ ‘)’ form separate words. If doubled in ‘&&’, ‘||’, ‘<<’ or ‘>>’ these pairs form single words.These parser metacharacters may be made part of other words, or prevented their special meaning, by preceding them with ‘\’. A newline preceded by a ‘\’ is equivalent to a blank.Strings enclosed in matched pairs of quotations, ‘’ ’, ‘`’ or ‘"’, form parts of a word; metacharacters in thesestrings, including blanks and tabs, do not form separate words. These quotations have semantics to be described later. Within pairs of ‘´’ or ‘"’ characters, a newline preceded by a ‘\’ gives a true newline character.When the shell’s input is not a terminal, the character ‘#’ introduces a comment that continues to the end ofthe input line.
It is prevented this special meaning when preceded by ‘\’ and in quotations using ‘`’, ‘´’, and‘"’.CommandsA simple command is a sequence of words, the first of which specifies the command to be executed. A simple command or a sequence of simple commands separated by ‘|’ characters forms a pipeline. The output ofeach command in a pipeline is connected to the input of the next. Sequences of pipelines may be separatedby ‘;’, and are then executed sequentially. A sequence of pipelines may be executed without immediatelywaiting for it to terminate by following it with an ‘&’.Any of the above may be placed in ‘(’ ‘)’ to form a simple command (that may be a component of a pipeline,etc.). It is also possible to separate pipelines with ‘||’ or ‘&&’ showing, as in the C language, that the secondis to be executed only if the first fails or succeeds respectively.
(See Expressions.)JobsThe shell associates a job with each pipeline. It keeps a table of current jobs, printed by the jobs command, and assigns them small integer numbers. When a job is started asynchronously with ‘&’, the shellprints a line that looks like:[1] 1234showing that the job which was started asynchronously was job number 1 and had one (top-level) process,whose process id was 1234.If you are running a job and wish to do something else you may hit the key ˆZ (control-Z) which sends aSTOP signal to the current job.
The shell will then normally show that the job has been ‘Stopped’, and printanother prompt. You can then manipulate the state of this job, putting it in the background with the bg command, or run some other commands and eventually bring the job back into the foreground with theforeground command fg. A ˆZ takes effect immediately and is like an interrupt in that pending output and4th Berkeley DistributionJanuary 21, 19942CSH ( 1 )UNIX Reference ManualCSH ( 1 )unread input are discarded when it is typed. There is another special key ˆY that does not generate a STOPsignal until a program attempts to read(2) it. This request can usefully be typed ahead when you have prepared some commands for a job that you wish to stop after it has read them.A job being run in the background will stop if it tries to read from the terminal.
Background jobs are normally allowed to produce output, but this can be disabled by giving the command ‘‘stty tostop’’. If you setthis tty option, then background jobs will stop when they try to produce output like they do when they try toread input.There are several ways to refer to jobs in the shell. The character ‘%’ introduces a job name. If you wish torefer to job number 1, you can name it as ‘%1’.
Just naming a job brings it to the foreground; thus ‘%1’ is asynonym for ‘fg %1’, bringing job number 1 back into the foreground. Similarly saying ‘%1 &’ resumes jobnumber 1 in the background. Jobs can also be named by prefixes of the string typed in to start them, if theseprefixes are unambiguous, thus ‘%ex’ would normally restart a suspended ex(1) job, if there were only onesuspended job whose name began with the string ‘ex’. It is also possible to say ‘%?string’ which specifies ajob whose text contains string, if there is only one such job.The shell maintains a notion of the current and previous jobs.
In output about jobs, the current job is markedwith a ‘+’ and the previous job with a ‘−’. The abbreviation ‘%+’ refers to the current job and ‘%−’ refers tothe previous job. For close analogy with the syntax of the history mechanism (described below), ‘%%’ isalso a synonym for the current job.The job control mechanism requires that the stty(1) option new be set.
It is an artifact from a new implementation of the tty driver that allows generation of interrupt characters from the keyboard to tell jobs tostop. See stty(1) for details on setting options in the new tty driver.Status reportingThis shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt.
This is done sothat it does not otherwise disturb your work. If, however, you set the shell variable notify, the shell willnotify you immediately of changes of status in background jobs. There is also a shell command notifythat marks a single process so that its status changes will be immediately reported.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.