Please reply to the mailing list, not just to me.
Ok, if the file is located in that dir relative to where you run LAMMPS, then it will not find it because you change the directory inside the script, it seems (shell cd $d).
If you already accounted for the fact that you change directories inside your script (e.g. by adding an additional “…/” to the potential file), then LAMMPS can somehow not open the file for another reason (it being read-protected or something). I’m guessing/hoping it is the former.