I encounter the problem that I can't save any output from Mathematica script. Here is a minimal example.
Export["/home/my_home_folder/file.txt", "hello world"]
I run the script with
math -script test.m
and the output file is not produced. Instead of
math I've also tried
wolframscript -f test.m, they hadn't work either.
Interactively, i.e. running
math from the terminal and executing the same
Export command, everything works just fine.
I run the script remotely using ssh on a Linux machine.
Is there a way to fix this or any alternative way of saving the data from the script mode?
OK, I resolved the problem and it was pretty dumb. I used Mathematica as an editor and my cells was of the "Input" type, but it should have been of the "Code" type, otherwise, it doesn't work.
Here is the non-working version of the code as it is viewed by Notepad:
(* ::Package:: *) (* ::Input:: *) (*Export["/home/my_home_folder/file.txt","hello world"]*)
And here is the working one:
(* ::Package:: *) (* ::Code:: *) (*Export["/home/my_home_folder/file.txt","hello world"]*)