# Correct way to plot with wolframscript

I am trying to run a .m file with wolfram script. I use the command

wolframscript -file name.m


It works until the program arrives to a Plot. I know that with wolfrascipt I cannot produce a graphic on screen as with the front-end, so I tried to suppress the output with a ;, as follows:

plot=Plot[Sin[x],{x,-Pi,Pi}];


and later to Export plot, but it still does not run.

How do I produce and save a plot with wolframscript?

• I forgot: I use Ubuntu 22.04 Mar 7 at 20:15
• What do you mean by "it does not run"? Can you show the screenshot from the command line? Writing plot=Plot[Sin[x],{x,-Pi,Pi}]; Export["test.png", plot]; should produce a valid output image ... Mar 7 at 20:19