Practicum - week 13


Please, in your mails, mention your regular e-mail address to which I can send my corrections.

Important remark for those who have already some previous knowledge of Unix: please use only the tools that we have learnt so far in your solutions, even if you can give another solution using a more advanced tool. If you cannot give a solution with the easier tools that other people have learned so far, then this means that you can still improve your knowledge of Unix. If you use tools that were not mentioned in the course so far, you receive less points, because the ultimate goal of the exercises is not to have those problems solved, rather to practice the tools that are part of the curriculum. Using more advanced tools means that you are not familiar enough with the basic tools, or it means that you are too lazy to think more.

For these assignments, you don't need to use information that appears on the web site of week 13, but was not mentioned on Wednesday (like 'cut' and 'paste').


1.

To make your life easier, create a soft link in your home directory towards /users1/birot/Federalist/. If you have this done, you can work in your own directory. If for instance Fed is the name of the link in your directory pointing to the above directory of mine, then you can use paths like Fed/jay64.txt or Fed/*.

Send to me the command line that creates the soft link.

(1 point)

2.

There is a Hungarian child game, and its name in Dutch would be something like: "Kavan jeve avals divit sprevekeven?" It is not Latin, but the point is to "break" all vowels by a [v] sound. So this would be the result of the sentence "Kan je als dit spreken?"

It would be nice to have a command line that receives a line from the standard input (the keyboard, or another file, if you insert a 'cat' before this command line), and outputs the same line in the "Kavan jeve avals divit sprevekeven"-language.

Can you write a command line that does this job?

Cavan yovouvu wriviteve ava covommavand livineve thavat dovoevos thivis jovob?

(3 points)
 
 

3.

In German, there are a few characters with accents (diacritical marks), as: ü, ä and ö. When writing an email (or sending a telex or telegram in ancient times...) German people usually use the following combinations instead: 'ue', 'ae' and 'oe' respectively, like: Oesterreich, Muenchen, Koeln, Duesseldorf, etc.

Give a command line that will transform a text writen in the standard way to a text written in the telegram-way. Give another command doing this transformation vice-versa.

Could you do that using only 'tr'? Explain your answer.

Tips:

Imagine that you don't have ü, ä and ö characters that you can just type (after installing German language to Linux) or that you just copy from somewhere else. You can do that when you experiment with one part of your solution, but this solution will not receive full points. (I want you to practice more than one tool...)

The Federalist papers don't contain German characters, as far as I know. You can download whatever German web site, or use the file: /users1/birot/German .

(3 points)



4.

Collect all the sentences in fed11.txt that are questions. (That end with a question mark.)

I would like to get each sentence in a different line. Tip: what about putting each sentence in a different line already at the beginning of the command line? This is useful, because for most of the Unix filters, one line is one unit.

You can be confused if the output of a command contains too long lines: because you don't know if the left edge of the screen is indeed the beginning of a line in the file (i.e. it follows a "new line" character), or it is just the continuation of the previous line. What can be useful (while you are experimenting) is to redirect the output of the command line into a file, and then look at that file with XEmacs or pico.

The lines in pico really correspond to the lines in the file. If a file is too long, then there is a '$' sign at the right end of the screen, and you can read the rest of the line by moving the cursor beyond the '$' sign. (Or you position your cursor at the beginning of the next line, and then you move your cursor left.) Be careful: if you insert a character in pico, then pico will automatically break the lines (that is, inserting an end-of-line character, a '\012').

XEmacs will show you the whole line by "breaking it visually": no end-of-line character is inserted, but the continuation of the line appears bellow. You can recognize nevertheless that this is not a new line by the small curved arrow at the right end of the screen.

Try typing a too long line both in XEmacs and pico. Enlarge the window, and try again...

(3 points)