1
$\begingroup$

My platform is Mac OS X Yosemite 10.10.1.

When calling several external linux commands as the following:

Import["!source ~/.bash_profile && alias", "Text"]

the results are not what expected, which obviously didn't source my configuration file. However, by replacing the && with ;, the following code

Import["!source ~/.bash_profile ; alias", "Text"]

works well.

The problem appears after upgrading to 10.0.2 and the former code worked well under previous versions on Yosemite.

I just want to confirm if this is a bug introduced in 10.0.2.

$\endgroup$
  • $\begingroup$ Import["!ls -l && pwd", "Text"] works for me with v.10.0.2 and OS X 10.9.5. $\endgroup$ – SquareOne Dec 25 '14 at 21:33
  • $\begingroup$ pwd does work with me. However, my case as in the question fails. $\endgroup$ – sunt05 Dec 25 '14 at 21:35
  • $\begingroup$ more specifically, source doesn't work. $\endgroup$ – sunt05 Dec 25 '14 at 21:36
  • $\begingroup$ ok, so I did the following test : 1/ created the file ~/test.txt containing the simple command ll=ls -l then 2/ in mma :Import["!source ~/test.txt && alias", "Text"] which returns properly returns ll=ls -l. Does it work for you ? $\endgroup$ – SquareOne Dec 25 '14 at 22:28
  • $\begingroup$ Hi @SquareOne, your method does work this time. But source my bash profile(i.e. ~/.bash_profile) still fails. So weird... However, this used to work. $\endgroup$ – sunt05 Dec 25 '14 at 22:36

Your Answer

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

Browse other questions tagged or ask your own question.