diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 9e1138cf..0852a3dd 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -3748,6 +3748,11 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts for (size_t pos = 0; pos < strlen(outname); pos++) if (outname[pos] == ':') //not allowed by MacOS outname[pos] = '_'; +#endif +#if !defined(_WIN64) || !defined(_WIN32) + for (size_t pos = 0; pos < strlen(outname); pos++) + if (outname[pos] == '`' || outname[pos] == '$') // unix shell expansion characters + outname[pos] = '_'; #endif cleanISO8859(outname); //re-insert explicit path separators: -f %t/%s_%p will have folder for time, but will not segment a protocol named "fMRI\bold"