#! /bin/csh foreach file ($argv) echo $file if (-w $file) then if (!(-d $file)) then echo $file exists but is not a directory; endif else mkdir $file endif end