# strange behavior when calling external linux command

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.

• Import["!ls -l && pwd", "Text"] works for me with v.10.0.2 and OS X 10.9.5. – SquareOne Dec 25 '14 at 21:33
• pwd does work with me. However, my case as in the question fails. – sunt05 Dec 25 '14 at 21:35
• more specifically, source doesn't work. – sunt05 Dec 25 '14 at 21:36
• 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 ? – SquareOne Dec 25 '14 at 22:28
• 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. – sunt05 Dec 25 '14 at 22:36