#! /bin/bash Files="LC.crunch cocomost.crunch cocomin_forward_16_correlation_mmre.crunch" for File in $Files do grep -v "#" $File | sort -g -k3 | gawk '{$1=NR;print $0}' > $File".byMMRE" grep -v "#" $File | sort -g -k4 | gawk '{$1=NR;print $0}' > $File".bySD" grep -v "#" $File | sort -g -k5 | gawk '{$1=NR;print $0}' > $File".byPred30" #sort -g -k4 > $File".sorted" #sort -g -t',' -k4 > $File".sorted" done