grep コマンドで取得した行番号の配列を使用して、行番号を増やし、sed コマンドで新しい行番号にあるものを取得しようとしていますが、構文に問題があると想定しています (具体的には、他のすべてが機能するため、sed部分。)
スクリプトは次のとおりです。
#!/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[@]}