Sorting and merging files
The following script merges several files into one file.
#!/bin/bash
echo "Please specify a directory"
read folder
cd $folder
ls | sort -n
for i in *.fasta
do
cat $i >> virus
done
Line 5 creates a sorted list of directory contents. Line six loops through all files with .fasta extension. Line 8 appends contents of every file to the file virus.