Главная » Просмотр файлов » UNIX Reference Manual

UNIX Reference Manual (794271), страница 2

Файл №794271 UNIX Reference Manual (UNIX Reference Manual) 2 страницаUNIX Reference Manual (794271) страница 22019-05-08СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

By default notifymarks the current process; simply say ‘notify’ after starting a background job to mark it.When you try to leave the shell while jobs are stopped, you will be warned that ‘You have stopped jobs.’You may use the jobs command to see what they are. If you do this or immediately try to exit again, theshell will not warn you a second time, and the suspended jobs will be terminated.File Name CompletionWhen the file name completion feature is enabled by setting the shell variable filec (see set), csh willinteractively complete file names and user names from unique prefixes, when they are input from the terminal followed by the escape character (the escape key, or control-[) For example, if the current directory lookslikeDSC.OLDDSC.NEWbenchbincmdchaosnet cmtestclassdevlibmailmboxxmpl.cxmpl.oxmpl.outand the input is% vi ch<escape>csh will complete the prefix ‘‘ch’’ to the only matching file name ‘‘chaosnet’’, changing the input line to% vi chaosnet4th Berkeley DistributionJanuary 21, 19943CSH ( 1 )UNIX Reference ManualCSH ( 1 )However, given% vi D<escape>csh will only expand the input to% vi DSC.and will sound the terminal bell to indicate that the expansion is incomplete, since there are two file namesmatching the prefix ‘‘D’’.If a partial file name is followed by the end-of-file character (usually control-D), then, instead of completingthe name, csh will list all file names matching the prefix.

For example, the input% vi D<control-D>causes all files beginning with ‘‘D’’ to be listed:DSC.NEWDSC.OLDwhile the input line remains unchanged.The same system of escape and end-of-file can also be used to expand partial user names, if the word to becompleted (or listed) begins with the character ‘‘˜’’. For example, typingcd ˜ro<escape>may produce the expansioncd ˜rootThe use of the terminal bell to signal errors or multiple matches can be inhibited by setting the variablenobeep.Normally, all files in the particular directory are candidates for name completion.

Files with certain suffixescan be excluded from consideration by setting the variable fignore to the list of suffixes to be ignored.Thus, if fignore is set by the command% set fignore = (.o .out)then typing% vi x<escape>would result in the completion to% vi xmpl.cignoring the files "xmpl.o" and "xmpl.out". However, if the only completion possible requires not ignoringthese suffixes, then they are not ignored. In addition, fignore does not affect the listing of file names bycontrol-D. All files are listed regardless of their suffixes.SubstitutionsWe now describe the various transformations the shell performs on the input in the order in which they occur.History substitutionsHistory substitutions place words from previous command input as portions of new commands, making iteasy to repeat commands, repeat arguments of a previous command in the current command, or fix spellingmistakes in the previous command with little typing and a high degree of confidence.

History substitutionsbegin with the character ‘!’ and may begin anywhere in the input stream (with the proviso that they donot nest.) This ‘!’ may be preceded by a ‘\’ to prevent its special meaning; for convenience, an ‘!’ is passedunchanged when it is followed by a blank, tab, newline, ‘=’ or ‘(’.

(History substitutions also occur when an4th Berkeley DistributionJanuary 21, 19944CSH ( 1 )UNIX Reference ManualCSH ( 1 )input line begins with ‘↑’. This special abbreviation will be described later.) Any input line that containshistory substitution is echoed on the terminal before it is executed as it could have been typed without historysubstitution.Commands input from the terminal that consist of one or more words are saved on the history list. The history substitutions reintroduce sequences of words from these saved commands into the input stream.

The sizeof the history list is controlled by the history variable; the previous command is always retained, regardless of the value of the history variable. Commands are numbered sequentially from 1.For definiteness, consider the following output from the history command:9101112write michaelex write.ccat oldwrite.cdiff ∗write.cThe commands are shown with their event numbers. It is not usually necessary to use event numbers, but thecurrent event number can be made part of the prompt by placing an ‘!’ in the prompt string.With the current event 13 we can refer to previous events by event number ‘!11’, relatively as in ‘!−2’ (referring to the same event), by a prefix of a command word as in ‘!d’ for event 12 or ‘!wri’ for event 9, or by astring contained in a word in the command as in ‘!?mic?’ also referring to event 9. These forms, without further change, simply reintroduce the words of the specified events, each separated by a single blank.

As aspecial case, ‘!!’ refers to the previous command; thus ‘!!’ alone is a redo.To select words from an event we can follow the event specification by a ‘:’ and a designator for the desiredwords. The words of an input line are numbered from 0, the first (usually command) word being 0, the second word (first argument) being 1, etc. The basic word designators are:0n↑$%x−y−y∗x∗x−first (command) wordn’th argumentfirst argument, i.e., ‘1’last argumentword matched by (immediately preceding) ?s? searchrange of wordsabbreviates ‘0−y´abbreviates ‘↑−$’, or nothing if only 1 word in eventabbreviates ‘x−$´like ‘x∗´ but omitting word ‘$’The ‘:’ separating the event specification from the word designator can be omitted if the argument selectorbegins with a ‘↑’, ‘$’, ‘∗’ ‘−’ or ‘%’.

After the optional word designator can be placed a sequence of modifiers, each preceded by a ‘:’. The following modifiers are defined:hRemove a trailing pathname component, leaving the head.rRemove a trailing ‘.xxx’ component, leaving the root name.eRemove all but the extension ‘.xxx’ part.s/l/r/Substitute l for rtRemove all leading pathname components, leaving the tail.&Repeat the previous substitution.gApply the change once on each word, prefixing the above, e.g., ‘g&’.aApply the change as many times as possible on a single word, prefixing the above. It can beused together with ‘g’ to apply a substitution globally.4th Berkeley DistributionJanuary 21, 19945CSH ( 1 )UNIX Reference ManualpqxCSH ( 1 )Print the new command line but do not execute it.Quote the substituted words, preventing further substitutions.Like q, but break into words at blanks, tabs and newlines.Unless preceded by a ‘g’ the change is applied only to the first modifiable word.

With substitutions, it is anerror for no word to be applicable.The left hand side of substitutions are not regular expressions in the sense of the editors, but instead strings.Any character may be used as the delimiter in place of ‘/’; a ‘\’ quotes the delimiter into the l and r strings.The character ‘&’ in the right hand side is replaced by the text from the left. A ‘\’ also quotes ‘&’. A null l(‘//’) uses the previous string either from an l or from a contextual scan string s in ‘!?s\?’.

The trailing delimiter in the substitution may be omitted if a newline follows immediately as may the trailing ‘?’ in a contextual scan.A history reference may be given without an event specification, e.g., ‘!$’. Here, the reference is to the previous command unless a previous history reference occurred on the same line in which case this form repeatsthe previous reference. Thus ‘!?foo?↑ !$’ gives the first and last arguments from the command matching‘?foo?’.A special abbreviation of a history reference occurs when the first non-blank character of an input line is a‘↑’.

This is equivalent to ‘!:s↑’ providing a convenient shorthand for substitutions on the text of the previousline. Thus ‘↑lb↑lib’ fixes the spelling of ‘lib’ in the previous command. Finally, a history substitution maybe surrounded with ‘{’ and ‘}’ if necessary to insulate it from the characters that follow. Thus, after ‘ls −ld˜paul’ we might do ‘!{l}a’ to do ‘ls −ld ˜paula’, while ‘!la’ would look for a command starting with ‘la’.Quotations with ´ and "The quotation of strings by ‘´’ and ‘"’ can be used to prevent all or some of the remaining substitutions.Strings enclosed in ‘´’ are prevented any further interpretation. Strings enclosed in ‘"’ may be expanded asdescribed below.In both cases the resulting text becomes (all or part of) a single word; only in one special case (see CommandSubstitution below) does a ‘"’ quoted string yield parts of more than one word; ‘´’ quoted strings never do.Alias substitutionThe shell maintains a list of aliases that can be established, displayed and modified by the alias andunalias commands.

After a command line is scanned, it is parsed into distinct commands and the firstword of each command, left-to-right, is checked to see if it has an alias. If it does, then the text that is thealias for that command is reread with the history mechanism available as though that command were the previous input line. The resulting words replace the command and argument list. If no reference is made to thehistory list, then the argument list is left unchanged.Thus if the alias for ‘ls’ is ‘ls −l’ the command ‘ls /usr’ would map to ‘ls −l /usr’, the argument list here being undisturbed. Similarly if the alias for ‘lookup’ was ‘grep !↑ /etc/passwd’ then ‘lookup bill’ would mapto ‘grep bill /etc/passwd’.If an alias is found, the word transformation of the input text is performed and the aliasing process beginsagain on the reformed input line.

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

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

Список файлов учебной работы

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