I need to read a file given to me in a script i made, the file can be any name, the input is as follows
./Naloga1.sh tocke < somefile.txt
This is the code i have:
while read line
do
echo $line
done <
The problem is, firstly if i put the script name at the done, it will read all the lines in my file - the last one. And secondly how can i acess the files name to then output it? If i echo $1 $2 $3, $1 comes as tocke and $2 and $3 dont exist