dfits GRA*fits | fitsort PRO.CATG | grep $1 | cut -f 1 > list.txt while read -r filename ; do echo "rm "$filename" " rm "$filename" done