答え1
おそらくあなたはこれが欲しいでしょう:
#!/bin/bash
COUNT=0
while read -r line; do
COUNT=$(( $COUNT + 1 ))
sed -n "$COUNT{p;q}" test1.txt >> solution$COUNT.txt
sed -n "$COUNT{p;q}" test2.txt >> solution$COUNT.txt
done < test1.txt
おそらくあなたはこれが欲しいでしょう:
#!/bin/bash
COUNT=0
while read -r line; do
COUNT=$(( $COUNT + 1 ))
sed -n "$COUNT{p;q}" test1.txt >> solution$COUNT.txt
sed -n "$COUNT{p;q}" test2.txt >> solution$COUNT.txt
done < test1.txt