How to loop multiple function in shell script?
You don't need a loop. You can do the whole thing with a simple awk one-liner:

awk -vRS='&gt;' 'FNR&gt;1{ printf "&gt;%s",$0 &gt; "gene"FNR-1".fasta"}' org*fasta


I ran this on your files and got:

$ for file in gene*; do echo "=== File: $file ==="; cat $file;  done
=== File: gene1.fasta ===
&gt;locus1 
ATGCGTAGAG
&gt;ysr
ATGTAGCGA
&gt;siv
TAGTAGTAT
=== File: gene2.fasta ===
&gt;LG12 
TATGCATGAT
&gt;inc
TGATCTATG
&gt;tdp
ATGAGTCGA
=== File: gene3.fasta ===
&gt;bpl
TAGATGGAT
&gt;pym
ATGCATAGA
&gt;tem
ATGCTHATG


Explanation


-vRS='&gt;' : set the record separator to &gt;. This will make awk consider every fasta sequence as a single "line". 
FNR&gt;1{foo} : FNR is the line number of the current file. Because &gt; is the first character of the entry, the first "line" will always be empty, so it needs t obe skipped.
printf "&gt;%s",$0 &gt; "gene"FNR-1".fasta" : this does the work. It prints a &gt; followed by the current "line" ($0, this is the entire sequence + the header) and redirects it into a file called gene, then the current line number -1 (-1 is needed because of the issue mentioned above) and a .fasta extension.


=====

Note that org*fasta will be expanded with the default collation order. This means that org10.fasta will be processed before org1.fasta:

$ printf "org1.fasta\norg10.fasta\n" | sort 
org10.fasta
org1.fasta


To avoid this and have the files in numerical order, you can use brace expansion instead of the *. So, if you know your files are all orgN.fasta where N can take values from 1 to 20, do this:

awk -vRS='&gt;' 'FNR&gt;1{ printf "&gt;%s",$0 &gt; "gene"FNR-1".fasta"}' org{1..20}.fasta