Exercises


1.

Assume that you are working with the following history list:

37 mail alex 38 cd /Users/jenny/correspondence/business/cheese_co 39 less letter.0321 40 vim letter.0321 41 cp letter.0321 letter.0325 42 grep hansen letter.0325 43 vim letter.0325 44 lpr letter* 45 cd ../milk_co 46 pwd 47 vim wilson.0321 wilson.0329 


Using the history mechanism, give commands to

  1. Send mail to Alex.

  2. Use vim to edit a file named wilson.0329.

  3. Send wilson.0329 to the printer.

  4. Send both wilson.0321 and wilson.0329 to the printer.

2.

How can you display the aliases currently in effect? Write an alias named homedots that lists the names (only) of all invisible files in your home directory.

3.

How can you prevent a command from sending output to the terminal when you start it in the background? What can you do if you start a command in the foreground and later decide that you want it to run in the background?

4.

What statement can you put in your ~/.tcshrc file to prevent accidentally overwriting a file when you redirect output? How can you override this feature?

5.

Assume that the working directory contains the following files:

adams.ltr.03 adams.brief adams.ltr.07 abelson.09 abelson.brief anthony.073 anthony.brief azevedo.99 


What happens if you press TAB after typing the following commands?

  1. less adams.1

  2. cat a

  3. ls ant

  4. file az

    What happens if you press CONTROL-D after typing the following commands?

  5. ls ab

  6. less a

6.

Write an alias named backup that takes a filename as an argument and creates a copy of that file with the same name and a filename extension of .bak.

7.

Write an alias named qmake (quiet make) that runs make with both standard output and standard error redirected to the file named make.log. The command qmake should accept the same options and arguments as make.

8.

How can you make tcsh always display the pathname of the working directory as part of its prompt?




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net