How do I rename fasta headers?
Why not use sed instead?

sed -e 's/chr_I/I/' -e 's/chr_V/V/' -e 's/chr_X/X/' mySequence.fasta &gt; mySeq.fasta


Or even simpler:

sed 's/chr_//' mySequence.fasta &gt; mySeq.fasta