0. Please, read through the web site containing the material of the Wednesday lecture.
1. Try out pico as a text editor, and try out pine by sending e-mails to each other.
2. 10 minutes of vi
Start vi by typing: ' vi <filename> '. Then don't panic!
There are tree modes in vi:
- command mode: typing a character means a command, and does not appear on the screen.
- input mode: now you can type in whatever text you wish into your text, to the place where the cursor is.
- status-line mode (last-line mode): issuing long commands that will appear on the bottom line of your screen.
Changing between these modes:
- when you enter vi, you are in the command mode;
- pressing the 'Esc' button ('escape') brings you back always to the command mode;
- from command mode 'a' or 'i' brings you to input mode;
- from command mode ':' brings you to the last-line mode.
In the input mode you can just type in your text, but you will sometimes be surprised that you are not able to delete it. Maybe you are even not able to use the keys for moving your cursor! Then go back to the command mode (by using Esc) and bring the cursor onto the character you wish to delete. Just press 'x' to delete. Then 'a' or 'i' will bring you back to input mode.
Are you lost and even not able to move your oursor? Use the h (left), j (down), k (up) and l (right) keys in the command line.
In fact 'x' deletes the given character by putting it into a buffer ("cut") and 'p' will paste it to the actual position of the cursor. If you wish to put more than one character into the buffer (e.g. copying or moving an entire word), then just type the number of characters before 'x'. For instance '5x' will delete five characters, and put them into the buffer. Finally, 'dd' will delete you a line, and put it into the buffer. If you get lost, just don't panic...
By pressing ':', you get to the last-line mode. Pressing
'vi' will start a new file ("new document"), 'vi
<file_name>' opens the mentioned file. Typing 'w'
save (write) our file, while typing 'w <file_name>' saves as (under) the given name.
Leaving this sadistic editor is possible by typing 'q'
(quit), 'q!' (quit, even if not saved) or by 'wq' (save and quit).
Now you can get back to pico ot (X)Emacs! Relax and enjoy having
3. Start XEmacs by typing 'xemacs &'.
Remark: the & symbol means that you want to run the program "in the background": you wish to get back the prompt immediately, before the launched program has quitted. If you don't add this symbol, you can't use that terminal (console) simultaneously with XEmacs. (Of course you can run another console...) Try out the difference.
Go through the XEmacs manual: after having launched XEmacs, type ^H T (CTRL-H, then T). Read it very carefully, and practice a lot.
There is no assignment about this now, but there will be some questions
about using Emacs or XEmacs in the final test: questions like
what is the key combination for easy commands,
that you use very often. So you should acquire
a basic skill of using Emacs or XEmacs, by working in these editors
as much as you can, instead of pico.
From now on we will work with the Federalist Papers. For more information about this project by George Welling see: USA project and also this site.
In the lab, you will find the files you need for the assignments under: /users1/birot/Federalist.
Read the README file in this directory. The most convenient way to do that is to use more README or less README. Try out both. You can also use cat README, especially if the file is shorter than one page. Alternatively, you can use a text editor, such as pico README or xemacs README, although these programs are slower and useless if you do not want to edit the file (you even risk to damage it).
Get a list of the files. Look at the content of some of them by using cat, more, less, vi, pico or (X)Emacs. Compare the different ways of looking at a file, and remember the differences between them.
Create a directory "Federalist" within your working directory, so that you can copy all files there, and then work there at your ease. Move into that directory, and from now on, this will be your current working directory.
Then, give the appropriate command lines using wildcards to execute exactly the following tasks (in this order), without leaving your own 'Federalist' directory:
Tip: as long as you are not sure that the expression containing a wildcard matches exactly the files you wanted, don't use the commands for copying, moving (and especially not removing!). Experiment first with the command for listing.
Send the solutions for these assignments to Tamás or Lonneke (email@example.com) by using either pine or Emacs / XEmacs or some other mailing program under Unix. You have to get acquainted with some mailing programs, therefore we don't accept mails sent from your regular university account or from some yahoo, etc. account.