I want to store the ith line of a file (filename stored in variable filename) into a new variable called line where:
filename=$2
i=$1
let's say for this sake i=1 and filename=names.txt):
line="$(sed '1q;d' names.txt)"
How would I store the actual filename and i variable?