Using an array of line numbers acquired through a grep command, I'm trying to then increase the line number and retrieve what is on the new line number with a sed command, but I'm assuming something is wrong with my syntax (specifically the sed part because everything else works.)
The script reads:
#!/bin/bash
#getting array of initial line numbers
temp=(`egrep -o -n '\<a class\=\"feed\-video\-title title yt\-uix\-contextlink yt\-uix\-sessionlink secondary"' index.html |cut -f1 -d:`)
new=( )
#looping through array, increasing the line number, and attempting to add the
#sed result to a new array
for x in ${temp[@]}; do
((x=x+5))
z=sed '"${x}"q;d' index.html
new=( ${new[@]} $z )
done
#comparing the two arrays
echo ${temp[@]}
echo ${new[@]}