Steps I took are in comments below:
# rename old file regardless of how messes up or not # it is using basename to get information needed killfile="${pref}.${ext}" # copy old file name to a different file name # using the mv command # mv ${old file name.ext} ${oldfile name//search pattern/replace with] # gives you a new file with what ever you named it mv "$killfile" "${killfile//*/killme.k}" #the then just delete it rm "killme.k" #by doing it this way I found that the system will see it thus # it eliminated my file with out getting # no such file or directory error - that I was getting By doing it this way I, found that the system will see it thus it eliminated my file without getting the no such file or directory error - that I was getting.