I'm working on Ubuntu 12.4 and I have matlab installed. Typically, in order to invoke matlab from terminal I have to type in '~/MATLAB/bin/matlab'. Obviously this is a bit annoying so I aliased this command by adding
alias matlab='sh ~/MATLAB/bin/matlab'
to .bashrc. Now everything is golden and typing 'matlab' in the terminal (bash) works from any directory.
The problem arises when I'm trying to invoke Matlab from a python script. having a statement like this:
>>> commands.getoutput('matlab')
'sh: 1: matlab: not found'
as it seems the alias is not being recognized. Just to make sure:
>>> commands.getoutput('~/MATLAB/bin/matlab')
works like a charm, and
>>> commands.getoutput('echo $SHELL')
'/bin/bash'
indeed verifies that python is trying to execute the cmd in bash...
Any idea what's happening here? why isn't the alias being recognized? how/can it be fixed?
Thanks!