Try using /usr/bin/stat instead of stat