Download VIM configuration file
1. Go to your home directory
1 |
cd ~ |
2. download the file
1 |
wget blue.pri.ee/.vimrc |
Decide on where to put your program(s) for this lab.
e.g. ~/P/IAX0583/ or something similar. Make sure that folder exist, if necessary create a new folder.
Use
cd to navigate,
mkdir to create a directory
Download the archived test program
1 |
wget blue.pri.ee/week7.zip |
You need to unzip the file
Use the program called
unzip
You may need to manually make it executable
You use
chmod for this
Note: From this point on you can try to run the program provided. I recommend you try this out now! The program will stop when an unmet requirement is encountered.
Copy over an additional data file with the secret
Go to the M: folder (~/M/). Find your lecturer’s directory and go to it. In there you will find a hidden directory – go to it (it starts with a dot).
Inside you will find a .dat file. Copy that file over to the same folder as the test program. For this you will need to use the cp command. Specify the file you want to copy and the path you want to copy it to.
To test if this worked, run the program and see if it finds the secret!
Next up you need to create a file with your matricula
For this, go back to the folder with your lab files. For this one, I’ll provide two possible options.
Option 1: Open up your favourable command line text editor, write a file called “matricula”
Vim guide:
-
- Start by writing vim matricula to create a file called matricula and open it in Vim.
- Press ‘i’ to enter writing mode.
- Now write your matricula.
- Press ‘esc’ to exit write mode.
- write :wq in normal mode to write the file and exit
Option 2: This is what most people actually would do. They would use the echo command and redirect the output streamto a file, e.g. echo "text" > file
Write another program that will print out “Hello world!”
Again use a command line text editor. We recommend Vim, as it supports C code, but you can use any other editor as well.
Once done, compile the program. Use “-o hello” to specify the name of the program as “hello”
Now run the test program that you downloaded from us. If everything was successful, you get a new file with instructions.
Follow the instructions or if necessary, fix the mistakes.