Главная » Просмотр файлов » W. Joy - An Introduction to the C shell

W. Joy - An Introduction to the C shell (794270), страница 12

Файл №794270 W. Joy - An Introduction to the C shell (W. Joy - An Introduction to the C shell) 12 страницаW. Joy - An Introduction to the C shell (794270) страница 122019-05-08СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 12)

Thecommand substitution mechanism can also be used to perform modification in a similarway, but this notation is less clear (3.6).moreThe program more writes a file on your terminal allowing you to control how much textis displayed at a time. More can move through the file screenful by screenful, line byline, search forward for a string, or start again at the beginning of the file. It is generallythe easiest way of viewing a file (1.8).noclobberThe shell has a variable noclobber which may be set in the file .login to prevent accidental destruction of files by the ‘>’ output redirection metasyntax of the shell (2.2, 2.5).noglobThe shell variable noglob is set to suppress the filename expansion of arguments containing the metacharacters ‘˜’, ‘*’, ‘?’, ‘[’ and ‘]’ (3.6).notifyThe notify command tells the shell to report on the termination of a specific backgroundjob at the exact time it occurs as opposed to waiting until just before the next prompt toreport the termination.

The notify variable, if set, causes the shell to always report thetermination of background jobs exactly when they occur (2.6).----An Introduction to the C shellUSD:4-41onintrThe onintr command is built into the shell and is used to control the action of a shellcommand script when an interrupt signal is received (3.9).outputMany commands in UNIX result in some lines of text which are called their output. Thisoutput is usually placed on what is known as the standard output which is normallyconnected to the user’s terminal.

The shell has a syntax using the metacharacter ‘>’ forredirecting the standard output of a command to a file (1.3). Using the pipe mechanismand the metacharacter ‘|’ it is also possible for the standard output of one command tobecome the standard input of another command (1.5). Certain commands such as theline printer daemon p do not place their results on the standard output but rather inmore useful places such as on the line printer (2.3). Similarly the write command placesits output on another user’s terminal rather than its standard output (2.3). Commandsalso have a diagnostic output where they write their error messages.

Normally these goto the terminal even if the standard output has been sent to a file or another command,but it is possible to direct error diagnostics along with standard output using a specialmetanotation (2.5).pathThe shell has a variable path which gives the names of the directories in which itsearches for the commands which it is given. It always checks first to see if the command it is given is built into the shell. If it is, then it need not search for the command asit 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 path variable, left to right. Sincethe normal definition of the path variable ispath (. /usr/ucb /bin /usr/bin)the shell normally looks in the current directory, and then in the standard system directories ‘/usr/ucb’, ‘/bin’ and ‘/usr/bin’ for the named command (2.2). If the command cannot be found the shell will print an error diagnostic.

Scripts of shell commands will beexecuted using another shell to interpret them if they have ‘execute’ permission set. Thisis normally true because a command of the formchmod 755 scriptwas executed to turn this execute permission on (3.3). If you add new commands to adirectory in the path , you should issue the command rehash (2.2).pathnameA list of names, separated by ‘/’ characters, forms a pathname. Each component,between successive ‘/’ characters, names a directory in which the next component fileresides.

Pathnames which begin with the character ‘/’ are interpreted relative to the rootdirectory in the filesystem. Other pathnames are interpreted relative to the current directory as reported by pwd. The last component of a pathname may name a directory, butusually names a file.pipelineA group of commands which are connected together, the standard output of each connected to the standard input of the next, is called a pipeline. The pipe mechanism usedto connect these commands is indicated by the shell metacharacter ‘|’ (1.5, 2.3).popdThe popd command changes the shell’s working directory to the directory you mostrecently left using the pushd command.

It returns to the directory without having to typeits name, forgetting the name of the current working directory before doing so (2.7).portThe part of a computer system to which each terminal is connected is called a port .Usually the system has a fixed number of ports , some of which are connected to telephone lines for dial-up access, and some of which are permanently wired directly to specific terminals.prThe pr command is used to prepare listings of the contents of files with headers givingthe name of the file and the date and time at which the file was last modified (2.3).printenvThe printenv command is used to print the current setting of variables in the environment (2.8).----USD:4-42An Introduction to the C shellprocessAn instance of a running program is called a process (2.6).

UNIX assigns each process aunique number when it is started − called the process number . Process numbers can beused to stop individual processes using the kill or stop commands when the processesare part of a detached background job.programUsually synonymous with command ; a binary file or shell command script which performs a useful function is often called a program .promptMany programs will print a prompt on the terminal when they expect input.

Thus theeditor ‘ex (1)’ will print a ‘:’ when it expects input. The shell prompts for input with ‘%’ and occasionally with ‘? ’ when reading commands from the terminal (1.1). The shellhas a variable prompt which may be set to a different value to change the shell’s mainprompt .

This is mostly used when debugging the shell (2.8).pushdThe pushd command, which means ‘push directory’, changes the shell’s working directory and also remembers the current working directory before the change is made,allowing you to return to the same directory via the popd command later without retyping its name (2.7).psThe ps command is used to show the processes you are currently running. Each processis shown with its unique process number, an indication of the terminal name it isattached to, an indication of the state of the process (whether it is running, stopped,awaiting some event (sleeping), and whether it is swapped out), and the amount of CPUtime it has used so far.

The command is identified by printing some of the words usedwhen it was invoked (2.6). Shells, such as the csh you use to run the ps command, arenot normally shown in the output.pwdThe pwd command prints the full pathname of the current working directory . The dirsbuiltin command is usually a better and faster choice.quitThe quit signal, generated by a control-\, is used to terminate programs which are behaving unreasonably. It normally produces a core image file (1.8).quotationThe process by which metacharacters are prevented their special meaning, usually byusing the character ‘´ in pairs, or by using the character ‘\’, is referred to as quotation(1.7).redirectionThe routing of input or output from or to a file is known as redirection of input or output(1.3).rehashThe rehash command tells the shell to rebuild its internal table of which commands arefound in which directories in your path .

This is necessary when a new program isinstalled in one of these directories (2.8).relative pathnameA pathname which does not begin with a ‘/’ is called a relative pathname since it isinterpreted relative to the current working directory . The first component of such apathname refers to some file or directory in the working directory , and subsequent components between ‘/’ characters refer to directories below the working directory . Pathnames that are not relative are called absolute pathnames (1.6).repeatThe repeat command iterates another command a specified number of times.rootThe directory that is at the top of the entire directory structure is called the root directorysince it is the ‘root’ of the entire tree structure of directories.

The name used in pathnames to indicate the root is ‘/’. Pathnames starting with ‘/’ are said to be absolutesince they start at the root directory. Root is also used as the part of a pathname that isleft after removing the extension . See filename for a further explanation (1.6).RUBOUTThe RUBOUT or DELETE key is often used to erase the previously typed character; someusers prefer the BACKSPACE for this purpose. On older versions of UNIX this key servedas the INTR character.----An Introduction to the C shellUSD:4-43scratch fileFiles whose names begin with a ‘#’ are referred to as scratch files , since they are automatically removed by the system after a couple of days of non-use, or more frequently ifdisk space becomes tight (1.3).scriptSequences of shell commands placed in a file are called shell command scripts .

It isoften possible to perform simple tasks using these scripts without writing a program in alanguage such as C, by using the shell to selectively run other programs (3.3, 3.10).setThe builtin set command is used to assign new values to shell variables and to show thevalues of the current variables. Many shell variables have special meaning to the shellitself. Thus by using the set command the behavior of the shell can be affected (2.1).setenvVariables in the environment ‘environ (5)’ can be changed by using the setenv builtincommand (2.8).

Характеристики

Тип файла
PDF-файл
Размер
185,84 Kb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6310
Авторов
на СтудИзбе
312
Средний доход
с одного платного файла
Обучение Подробнее