By the way can you explain the single quotation '$f'? I have tried with double quotation and it simply replaced the line with "$f". And why the curvy bracket at the end? Apology if the answers are very obvious. I'm actually a biologist. Thank you.
Curvy bracket is used to distinguish the actual variable name. Without curvy bracket is will consider the whole as variable name: $f_v1.fa; but with curvy bracket it will consider only $f as variable name: ${f}_v1.fa;
To be precise, without the braces, the variable name ends with the character before the dot, ${f_v1}.fa , since the dot is not allowed in a variable name [1].
Regards,
Alister
ksh does allow dots in a variable name, but those names MUST appear within braces