Either of
Code:
txt=$(sed -n -e "${ln[0]},${ln[1]} p" -e "${ln[1]} q" Notes)
txt=$(awk -v x=${ln[0]} -v y=${ln[1]} 'NR>x, NR<y' < Notes)
does what I want
except all the newlines are removed if their output goes to a variable. How can I preserve them?