Reputation: 945
Im trying executing a python file from an alias (macosx).
It's possible?.
alias execute ='python path/file.py'
Im trying like this, but doesn't work, any suggestion?
Thanks
Upvotes: 3
Views: 709
Reputation: 500663
Remove the space before the =
, and it should work:
$ cat /tmp/x.py
print 'hello, world!'
$ alias execute='python /tmp/x.py'
$ execute
hello, world!
Also note that I'm using the absolute path (/tmp
). Using a relative path would make the command work in some directories, but not in others.
Upvotes: 3