I would like to find directories that does not contain a file with name OSZICAR and then cd into that directory and do something more...all i have now is:find `pwd` -mindepth 2 -maxdepth 2 -type d -exec sh -c echo {}; cd {}; ls; if [! -f $0/OSZICAR];echo doing my thing;fi \;but there is error, could anyone help? Thank youMy original command without the Criteria of Not having OSZICAR is:find `pwd` -mindepth 2 -maxdepth 2 -type d -exec sh -c echo {}; cd {}; ls; cp ../../submit_script_Stampede.sh .; ls;sed -i s/Monkhorst/Gamma/ KPOINTS; cp CONTCAR POSCAR ;sbatch submit_script_Stampede.sh \; 
find a directories that does not contain a file with name OSZICAR and then cd into that directory and do something more
find
for dir in $(find ${PWD} -mindepth 2 -maxdepth 2 -type d)do  cd ${dir}  ls OSZICAR > /dev/null 2>&1; r=${?}  if [ ${r} -ne 0 ]  then     # do your thing here  fidone