-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
shell command fails in IJulia #485
Comments
What do Does it work if you do the same thing in the Julia REPL (i.e. the (What is the |
(Note that |
First, thanks for the reply! 1- same directory Thanks |
Hmm, can you try: Base.repl_cmd(`sustrip<src.su>src.rsf@`) and Base.repl_cmd(@cmd("sustrip<src.su>src.rsf@")) to see if either works in IJulia? IJulia is transforming your line into the former, but I suspect we should be using the latter. |
Base.repl_cmd(`sustrip<src.su>src.rsf`,STDOUT)
sustrip: subcalls.c: efopen: fopen failed
Base.repl_cmd(@cmd("sustrip<src.su>src.rsf@"),STDOUT)
sustrip: subcalls.c: efopen: fopen failed |
Ok, some advance here, the command has a optional argument ;sustrip <src.su outpar=par >src.rsf@ Feel free to close the issue if that is not something that impedes other users. Thank you guys for your help! |
It probably has to do with the fact that Not sure if anything can be done here. cc @JobJob |
Sorry @stevengj, also missed this mention. @raminammour does this work in IJulia?
|
@JobJob same error for above command |
Had a quick look at the code for Base.repl_cmd It seems commands are run differently if STDIN is a TTY (which at the REPL it is, but in IJulia it isn't), see this line: So I think that's the difference, not sure how ipython runs shell commands but doing this:
gives me a warning:
So I don't think we want to mess with this. I imagine if you replace my I'm guessing this is more of an issue with shell commands that expect to be run interactively than with IJulia. |
It gives: cmd =`sustrip<src.su>src.rsf@`
shell = Base.shell_split(get(ENV,"JULIA_SHELL",get(ENV,"SHELL","/bin/sh")))
run(`$shell -i -c "($(Base.shell_escape(cmd))) && true"`)
bash: no job control in this shell
sustrip: subcalls.c: efopen: fopen failed I tried with different options for sh and had the same error too. |
I really think the problem is In Julia Repl: ;tty
/dev/pts/97 In IJulia from Jupyter: ;tty
not a tty In Python from Jupyter !tty
/dev/pts/80 Hope this helps :) |
Ok thanks. I think this is such a rare issue that I can live with it for now. Thanks for reporting, it might help someone else one day. |
Thank you guys for your help! |
Hello all,
I am using Jupyter 4.2.0, I execute this command in Julia 0.4 and 0.5:
Whereas if I change the kernel to python:
It works normally (as if executed from shell).
Your help is much appreciated!
The text was updated successfully, but these errors were encountered: