in reply to Re^4: Creating result file with time stamp
in thread Creating result file with time stamp
mkdir creates a directory, not a file. It's trying to create a subdirectory (what you intended to be a file) under a directory that doesn't yet exist. It then creates that parent directory, your original intention. Create the file as a seperate step after creating the directory.