Transcription of An Introduction to the C shell - Kitebird
1 -- --An Introduction to the C shellWilliam Joy(revised for by Mark Seiden)Computer Science DivisionDepartment of Electrical Engineering and Computer ScienceUniversity of California, BerkeleyBerkeley, California 94720 ABSTRACTC shis a newcommand language interpreter forUNIX systems. Itincorporatesgood features of other shells and ahistorymechanism similar to incorporating manyfeatures of other shells which makewriting shell programs( shell scripts)
2 Easier,most of the features unique tocshare designed more for the who have read a general Introduction to the system will find a valuablebasic explanation of the shell terminal interaction withcshis possible afterreading just the first section of this second section describes the shell scapabilities which you can explore after you have begun to become acquainted with theshell. Latersections introduce features which are useful, but not necessary for all users ofthe information includes an appendix listing special characters of the shelland a glossary of terms and commands introduced in this a command language the name of one particular command primary purpose ofcshis to translate command lines typed at a terminal into system actions,such as invocation of other a user program just likeany you might.
3 Cshwill be a very useful program for you in interacting with addition to this document, you will want to refer to a copyoftheUNIXUser Reference in section 1 of the manual provides a full description of all features of the shell andis the definitive reference for questions about the in this document are shown are important words; names of commands,and words which have special meaning in discussing the shell words are defined inaglossary at the end of this you don tknowwhat is meant by a word, you should look for itin the people have provided good input about previous versions ofcshand aided in its debug-ging and in the debugging of its especially liketothank Michael Ubell who madethe crucial observation that history commands could be done well overthe word structure of input text.
4 Andimplemented a prototype history mechanism in an older version of the Allman has also providedalarge number of useful comments on the shell , helping to unify those concepts which are present and to UNIXis a trademark of Bell --USD:4-2 AnIntroduction to the C shellidentify and eliminate useless and marginally useful Brien suggested the pathname hash-ing mechanism which speeds command execution.
5 JimKulp added the job control and directory stackprimitivesand added their documentation to this --An Introduction to the C shellUSD:4-31. Terminal usage of the Thebasic notion of commandsAshellinUNIX acts mostly as a medium through which otherprogramsare invoked. Whileit has aset ofbuiltinfunctions which it performs directly,most commands cause execution of programs that are, infact, external to the shell is thus distinguished from the command interpreters of other systemsboth by the fact that it is just a user program, and by the fact that it is used almost exclusively as a mecha-nism for invoking other theUNIX system consist of a list of strings orwordsinterpreted as acommand namefollowed the commandmail billconsists of twowords.
6 Thefirst wordmailnames the command to be executed, in this case the mail pro-gram which sends messages to other shell uses the name of the command in attempting toexecute it for will look in a number ofdirectoriesfor a file with the namemailwhich is expected tocontain the mail rest of the words of the command are givenasargumentsto the command itself when it isexecuted. Inthis case we specified also the argumentbillwhich is interpreted by themailprogram to bethe name of a user to whom mail is to be normal terminal usage we might use themailcommandas billIhav eaquestion about the csh document seems to be missing page a page fiveexist?
7 BillEOT%Here we typed a message to send tobilland ended this message with a D which sent an end-of-fileto the mail program.(Here and throughout this document, the notation x istoberead control-x andrepresents the striking of thexkeywhile the control key isheld down.) Themail program then echoed thecharacters EOT and transmitted our characters % were printed before and after the mailcommand by the shell to indicate that input was typing the % prompt the shell was reading command input from our typed acomplete command mail bill.
8 The shell then executed themailprogram with argumentbilland wentdormant waiting for it to mail program then read input from our terminal until we signalledan end-of-file via typing a D after which the shell noticed that mail had completed and signaled us that itwasready to read from the terminal again by printing another % is the essential pattern of all interaction withUNIX through the command istyped at the terminal, the shell executes the command and when this execution completes, it prompts for anewcommand.
9 Ifyou run the editor for an hour,the shell will patiently wait for you to finish editing andobediently prompt you again wheneveryou finish example of a useful command you can execute nowisthetsetcommand, which sets the defaulteraseandkillcharacters on your terminal the erase character erases the last character you typed and thekill character erases the entire line you have entered so , the erase character is the delete key(equivalent to ? )and the kill character is U .Some people prefer to makethe erase character thebackspace key (equivalent to H ).
10 Youcan makethis be true by typingtset ewhich tells the programtsetto set the erase character to tset sdefault setting for this character (abackspace).-- --USD:4-4 AnIntroduction to the C FlagargumentsAuseful notion inUNIXis that of aflagargument.