I have a script I wish to run through a directory of files:awk '{if(NR%4==1) {printf(>%s\n,substr($0,2));} else if(NR%4==2) print;}' < TNGA_C_0hr_Joined_Asz1.fastqsanger | awk 'NR%2==0' | sed 's/TGAGATGTGA/*/p'  | cut -d '*' -f 2 -s | sort -k 1.180,1.194 -u | cat -n | sed 's/^/>/' | tr [\t] \n > TNGA_C_0hr_Asz1_Collapsed.fastaI have tested this script, and it works fine for what I need it to do.What I want to do is create a for loop that will apply it to all the files in a directory. I've tried the below, and it did not work. Variations of it have also been tried.for filename in /Test/*.fastqsanger; do    awk '{if(NR%4==1) {printf(>%s\n,substr($0,2));} else if(NR%4==2) print;}' < filename.fastqsanger | awk 'NR%2==0' | sed 's/TGAGATGTGA/*/p'  | cut -d '*' -f 2 -s | sort -k 1.180,1.194 -u | cat -n | sed 's/^/>/' | tr [\t] \n > filename.fastadoneI'm fairly new to programming so any help is appreciated.
Using a 'for loop', run a script on all files in a directory
shell script;files