I've got done the following parameter shell expansion:
trihead="$(cat ../FASTA_SEC/"$i".fa)"
echo "${trihead#"${trihead%%[!A]*}"}" > ../FASTA_SEC/"$i".fa
I'd like to trim the leading A's from the second line of a fasta file (a kind of plain text format .fa)
the input would be something like:
>B4-0K032_18670_015
AAAAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNGNNNTAGATACAAGCGAGCGGC
and i'd like the output to be like:
>B4-0K032_18670_015
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNGNNNTAGATACAAGCGAGCGGC
By the way, does anybody know some side where shell parameter expansion is well explained?
sed
orawk
, depending on what it is you're trying to achieve on that second line.