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

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

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

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

It is usually used on binary files, or to see iftwo files are identical (3.6). For comparing text files the program diff , described in ‘diff(1)’ is used.commandA function performed by the system, either by the shell (a builtin command ) or by a program residing in a file in a directory within the UNIX system, is called a command (1.1).command nameWhen a command is issued, it consists of a command name , which is the first word ofthe command, followed by arguments. The convention on UNIX is that the first word of acommand names the function to be performed (1.1).command substitutionThe replacement of a command enclosed in ‘`’ characters by the text output by that command is called command substitution (4.3).componentA part of a pathname between ‘/’ characters is called a component of that pathname .

Avariable which has multiple strings as value is said to have several component s; eachstring is a component of the variable.continueA builtin command which causes execution of the enclosing foreach or while loop tocycle prematurely. Similar to the continue command in the programming language C(3.6).----USD:4-36An Introduction to the C shellcontrol-Certain special characters, called control characters, are produced by holding down theCONTROL key on your terminal and simultaneously pressing another character, much likethe SHIFT key is used to produce upper case characters. Thus control- c is produced byholding down the CONTROL key while pressing the ‘c’ key. Usually UNIX prints an caret(ˆ) followed by the corresponding letter when you type a control character (e.g.

‘ˆC’ forcontrol- c (1.8).core dumpWhen a program terminates abnormally, the system places an image of its current statein a file named ‘core’. This 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 theshell produces a message of the formIllegal instruction (core dumped)(where ‘Illegal instruction’ is only one of several possible messages), you should reportthis to the author of the program or a system administrator, saving the ‘core’ file.cpThe cp (copy) program is used to copy the contents of one file into another file.

It is oneof the most commonly used UNIX commands (1.6).cshThe name of the shell program that this document describes..cshrcThe file .cshrc in your home directory is read by each shell as it begins execution. It isusually used to change the setting of the variable path and to set alias parameters whichare to take effect globally (2.1).cwdThe cwd variable in the shell holds the absolute pathname of the current workingdirectory .

It is changed by the shell whenever your current working directory changesand should not be changed otherwise (2.2).dateThe date command prints the current date and time (1.3).debuggingDebugging is the process of correcting mistakes in programs and shell scripts. The shellhas several options and variables which may be used to aid in shell debugging (4.4).default:The label default: is used within shell switch statements, as it is in the C language tolabel the code to be executed if none of the case labels matches the value switched on(3.7).DELETEThe DELETE or RUBOUT key on the terminal normally causes an interrupt to be sent to thecurrent job. Many users change the interrupt character to be ˆC.detachedA command that continues running in the background after you logout is said to bedetached .diagnosticAn error message produced by a program is often referred to as a diagnostic .

Most errormessages are not written to the standard output , since that is often directed away fromthe terminal (1.3, 1.5). Error messsages are instead written to the diagnostic outputwhich may be directed away from the terminal, but usually is not. Thus diagnostics willusually appear on the terminal (2.5).directoryA structure which contains files. At any time you are in one particular directory whosenames can be printed by the command pwd . The chdir command will change you toanother directory , and make the files in that directory visible.

The directory in whichyou are when you first login is your home directory (1.1, 2.7).directory stackThe shell saves the names of previous working directories in the directory stack whenyou change your current working directory via the pushd command.

The directorystack can be printed by using the dirs command, which includes your current workingdirectory as the first directory name on the left (2.7).dirsThe dirs command prints the shell’s directory stack (2.7).duThe du command is a program (described in ‘du (1)’) which prints the number of diskblocks is all directories below and including your current working directory (2.6).----An Introduction to the C shellUSD:4-37echoThe echo command prints its arguments (1.6, 3.6).elseThe else command is part of the ‘if-then-else-endif’ control command construct (3.6).endifIf an if statement is ended with the word then , all lines following the if up to a line starting with the word endif or else are executed if the condition between parentheses afterthe if is true (3.6).EOFAn end-of-file is generated by the terminal by a control-d, and whenever a commandreads to the end of a file which it has been given as input.

Commands receiving inputfrom a pipe receive an end-of-file when the command sending them input completes.Most commands terminate when they receive an end-of-file . The shell has an option toignore end-of-file from a terminal input which may help you keep from logging out accidentally by typing too many control-d’s (1.1, 1.8, 3.8).escapeA character ‘\’ used to prevent the special meaning of a metacharacter is said to escapethe character from its special meaning. Thusecho \*will echo the character ‘*’ while justecho *will echo the names of the file in the current directory.

In this example, \ escape s ‘*’(1.7). There is also a non-printing character called escape , usually labelled ESC or ALTMODE on terminal keyboards. Some older UNIX systems use this character to indicatethat output is to be suspended .

Most systems use control-s to stop the output and control-q to start it./etc/passwdThis file contains information about the accounts currently on the system. It consists ofa line for each account with fields separated by ‘:’ characters (1.8). You can look at thisfile by sayingcat /etc/passwdThe commands finger and grep are often used to search for information in this file. See‘finger (1)’, ‘passwd(5)’, and ‘grep (1)’ for more details.exitThe exit command is used to force termination of a shell script, and is built into the shell(3.9).exit statusA command which discovers a problem may reflect this back to the command (such as ashell) which invoked (executed) it.

It does this by returning a non-zero number as its exitstatus , a status of zero being considered ‘normal termination’. The exit command canbe used to force a shell command script to give a non-zero exit status (3.6).expansionThe replacement of strings in the shell input which contain metacharacters by otherstrings is referred to as the process of expansion . Thus the replacement of the word ‘*’by a sorted list of files in the current directory is a ‘filename expansion’. Similarly thereplacement of the characters ‘!!’ by the text of the last command is a ‘history expansion’. Expansions are also referred to as substitutions (1.6, 3.4, 4.2).expressionsExpressions are used in the shell to control the conditional structures used in the writingof shell scripts and in calculating values for these scripts.

The operators available inshell expressions are those of the language C (3.5).extensionFilenames often consist of a base name and an extension separated by the character ‘.’.By convention, groups of related files often share the same root name. Thus if ‘prog.c’were a C program, then the object file for this program 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 listof spelling errors in ‘paper.errs’ (1.6).----USD:4-38An Introduction to the C shellfgThe job control command fg is used to run a background or suspended job in the foreground (1.8, 2.6).filenameEach file in UNIX has a name consisting of up to 14 characters and not including thecharacter ‘/’ which is used in pathname building.

Most filenames do not begin with thecharacter ‘.’, and contain only letters and digits with perhaps a ‘.’ separating the baseportion of the filename from an extension (1.6).filename expansionFilename expansion uses the metacharacters ‘*’, ‘?’ and ‘[’ and ‘]’ to provide a convenient mechanism for naming files. Using filename expansion it is easy to name all thefiles in the current directory, or all files which have a common root name. Other filenameexpansion mechanisms use the metacharacter ‘˜’ and allow files in other users’ directories to be named easily (1.6, 4.2).flagMany UNIX commands accept arguments which are not the names of files or other usersbut are used to modify the action of the commands. These are referred to as flagoptions, and by convention consist of one or more letters preceded by the character ‘−’(1.2).

Thus the ls (list files) command has an option ‘−s’ to list the sizes of files. This isspecifiedls −sforeachThe foreach command is used in shell scripts and at the terminal to specify repetition ofa sequence of commands while the value of a certain shell variable ranges through aspecified list (3.6, 4.1).foregroundWhen commands are executing in the normal way such that the shell is waiting for themto finish before prompting for another command they are said to be foreground jobs orrunning in the foreground . This is as opposed to background .

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

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

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

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