In bash (4.3.46(1)) I have some multi-line so called fasta records where each record is initiated by on line with >name and the following lines DNA sequence ([AGCTNacgtn]),
You should install the FAST perl package. It contains many utilities directly usable from the shell for dealing with fasta files, like fashead or fastail (and much more)
after installing it is simple as:
fashead -n2 fastafile | fastail -n1
output
>chr2
TTGNA.....
or even simpler
fasgrep chr2 fastafile
with the same output...