Solution using awk


#1

r=10
awk ‘NR==’$r’ {print $0}’ input