Q:

Unix Shell script task. Files as parameters?

I got this question. I am still a newbie, I don't know how to make files as parameters.

There is an attendance list of a class (class.dat - name; neptun code). At the end of summer they keep a great party with guests too. The participants of the party are given in a file party.txt (name; neptun code). Create a script together.sh which contains the names from class.dat and from party.dat but each name only once! The parameters of the script should be the two file names.

A:

Command-line arguments to bash scripts are stored in the special variables $1 for the first space-separated argument, $2 for the second and so on.
See also TLDP Advanced Bash Scripting Guide - 4.4. Special Variable Types (section Positional parameters) or man bash (section Parameters).
You should remember to always put your variables inside double-quotes (like "$1") though, to avoid getting them split up if they contain spaces.
Here is an example:
#!/bin/bash

echo "The first file, $1, starts with these lines:"
head "$1"

echo "The second file, $2, ends with these lines:"
tail "$2"

For getting all unique lines from both files together, take a look at the sort command (type man sort), especially its -u option...

