6
$\begingroup$

As we know, Linux’s Bash shell is coming to Windows 10. Now, I want to know, how to using Run[] command or other commands to run some commands like gfortran installed in Linux of Win10 ? And, is it possible to call mathematica using Bash shell in Windows 10 ?

$\endgroup$
5
$\begingroup$

As we also know from a number of sources, bash-over-windows-10 is in beta, not yet feature complete, and it is not really meant to interface with Windows apps at the moment. If you can get a command to run from a cmd shell (like, say, running bash -c "vi", which will hopefully launch a graphical vi instance) then it should work just fine through Run[]. Otherwise, you're probably asking too much from asystem that is too young at the moment. Similarly, launching a Mathematica kernel from inside bash seems unlikely to be possible anytime soon.

$\endgroup$
4
$\begingroup$

Installing the Windows git-bash version from here enables a simple way to run bash under Windows 10 from Mathematica:

RunProcess[{"C:\\Program Files\\Git\\bin\\bash.exe", "-c", 
  "bash --version | head -1 | tr -d '\n'"}, "StandardOutput"]

results in

(* "GNU bash, version 4.3.46(2)-release (x86_64-pc-msys)" *)
$\endgroup$
  • $\begingroup$ I think it's not specifically bash that he wanted, but running native Linux programs in the Windows Subsystem for Linux. $\endgroup$ – Szabolcs Feb 3 '17 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.