These are the exercises and references for the first class of the course Dokumenthanteringen
printf "octal: %o\n" 224
printf "hexadecimal: %x\n" 224
In the first string %d will print a decimal number, %o will print an octal number and %x (or %X) will print a hexadecimal number. The number behind the string (in this case 224) will be interpreted as a decimal number. Use this printf command to verify the numbers shown in the table in section 1.1. The same can be done with the following perl script:
#!/usr/local/bin/perl for (4,10) { printf "decimal %3d; octal %3o; hexadecimal %3x\n", $_, $_, $_; }
#!/usr/local/bin/perl printf "%c%c%c%ca%cb%c\n", 7, 10, 13, 127, 8;
The %c will print a character with the decimal ASCII value which has been specified behind the string. The result will depend on the terminal configuration you are using. The a or the b may be deleted by the next control character and you may here a bell. Try running the command and piping it to the more command. This should remove the bell sound and show ^G.
Example:
xterm -fn -urw-courier-medium-r-normal--13-100-100-100-m-80-iso8859-5
starts an xterm window with font ISO 8859-5 size 13.
You can also work with the different character sets by starting one of the programs aixterm1, aixterm2, and so on or emacs1, emacs2 and so on. These programs start either aixterm or emacs with the font ISO 8859-X in which X is the digit in the program name. Again you can get an overview of the characters that are being used by typing asciiTable in one of the aixterm windows.
Use these overviews and the web page mentioned in the references to choose the best ISO 8859 character set for displaying an aligned text in Swedish and Slovenian. The character set should include as many as possible characters with diacritics of both languages. For Swedish the lower case characters with diacritics are å, ä, ö and é. For Slovenian these are
v v v c, s and z.