Do[( ND$T$thr[j] = j; ND$T$thr[j] >> "test_" <> ToString[j] <> ".dat"; ), {j, 1, 3}]
This works without issue in a notebook and creates 3 files with different file names and different content. However, in a .m file that I run on ubuntu in the terminal with math -script test.m &
this fails, with the error
StringJoin::string: String expected at postion 1 in Null<>1.dat.
Any ideas why and how to fix this?Thanks!