spool directory does not exist in ubuntu. newline character not escaped properly in echo statement.