Alright so here i am struggling with this awk code wich should emulate the tail command
num=$1; { vect[NR]=$0; } END{ for(i=NR-num;i<=NR;i++)
You need to add -v num=10 to the awk commandline to set the value of num. And start at NR-num+1 in your final loop, otherwise you'll end up with num+1 lines of output.
-v num=10
num
NR-num+1
num+1