string s1,s2 int i list="alldirs" i=0 while(fscan(list,s1)!=EOF){ cd("/Volumes/Swope/"//s1) delete("temp") files ("ccd*.fits", > "temp") i=i+1 s2="n"//i imrename("@temp",s2//"@temp") !mv n* ../. }