Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--execute does not work as expected #712

Closed
Yurlungur opened this issue Aug 5, 2017 · 6 comments · Fixed by #1455
Closed

--execute does not work as expected #712

Yurlungur opened this issue Aug 5, 2017 · 6 comments · Fixed by #1455
Labels

Comments

@Yurlungur
Copy link

When I run

mathics -e "Print[1+1];" -script myfile.mathics

where myfile.mathics simply contains the line Print["Hello"]; I get

In[1]:= Print[1+1];
6

And myfile.mathics does not execute. This seems counter to the information printed with mathics -h. What should happen and what I would like to be able to do is that Print[1+1]; should be executed and then myfile.mathics should be run as a script.

I'm happy to help fix this if I can figure out where this functionality is being implemented. Can you point me to the right part of the code?

@Yurlungur Yurlungur changed the title --execute does not work as expectedo --execute does not work as expected Aug 5, 2017
@GarkGarcia GarkGarcia added the bug label Sep 8, 2020
@GarkGarcia
Copy link
Contributor

Hey @Yurlungur. If you're still interested, the bug is probably somewhere in main.py.

I'm not sure the bug is still present thought. I'll investigate it.

@Yurlungur
Copy link
Author

Wow. I'd completely forgotten about this. Sure, I'm still interested, if the bug is still present. I'll take a look.

@rocky
Copy link
Member

rocky commented Jun 28, 2021

@Yurlungur

Here is what I am currently getting:

$ mathics -e "Print[1+1];" -script /myfile.mathics
2
None

Personally I find mxing -e and -script and Print weird. What was it you were really trying to do?

@Yurlungur
Copy link
Author

Honestly, it's been so long that I don't remember why I wanted to do this. An easy fix might be to just put that one can't mix these flags into the help message and move on.

@TiagoCavalcante
Copy link
Contributor

@Yurlungur I'm fixing it.

@rocky
Copy link
Member

rocky commented Jun 28, 2021

Personally, I'd like to understand the use case and then document this assuming it is useful. Or if it matches the behavior of the WL command line options that is useful to know too.

Also a unit test would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants