Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

The line

if ( -f $name ) then

tests to see if the file whose name is in $name is an ordinary file, as opposed to a directory file. The -n option of echo tells the shell not to print the newline character, so that our answer, y/n/q, will be on the same line. In the line
set ans = $<

the symbol `$ < ' means the input from the keyboard. The keyword `continue' means to go to the top of the enclosing loop. The -r option of the rm command means that if an argument is a directory, then remove that directory, and all the files (and subdirectories, etc.) within it.

7 Further Information
There are several books dealing with the C shell, but you should first read the man page for csh. You will find all kinds of features not mentioned here.

An Introduction to the Unix Shell


This is an HTMLized version of Steve Bourne's original shell tutorial. I found the source at http://cm.belllabs.com/7thEdMan/vol2/shell.bun and generated my own copy with troff, which I then edited into an HTML version.

This 1978 classic (not sure about the exact date, corrections welcome) is not only historically interesting, it's still a good tutorial as long as you keep in mind that some minor details like the terminal interface have changed quite a bit (DEL is not usually the interrupt character anymore, etc). The same goes, by the way, for a lot of the old Unix documentation from Murray Hill, including the excellent book The Unix Programming Environment by Kernighan and Pike. You will find numerous other copies of this on the web, all of them -- as far as I can tell -- badly malformatted; for example, the pipe character will be completely missing throughout the document! The original version I found was "updated for 4.3BSD by Mark Seiden" but as I didn't have Seiden's troff source for the updated version, only an online copy with the usual formatting

errors, and it had very marginal changes as compared to the older version at Bell (remark that this is not a csh tutorial; different mail spool directory; mentioned that section 2 of the manual covers system calls; BSD has some new signals), I decided to go with the original. If you find errors in this or otherwise wish to comment, please don't hesitate to mail me.
/* era */

You might also like