Take the tour ×  I have an alias for a command (I'm setting up a
Python development environment)  alias
python=~/virtualenv/bin/python  so that I can run
~/virtualenv/bin/python by just typing python. Now in my project
there is a shell script that goes, for example:  python run-
project.py  Can I make the script use my aliased python instead
of the python it finds in $PATH, without making changes to the
script?  share|improve this question Out of interest, why can't
you change PATH? Changing PATH and putting #!/usr/bin/env python
at the top of your python scripts seems easier. –  Mikel Mar 2
'11 at 2:55 @Mikel This is even better than your other answer.
Can't accept comments, though. –  phunehehe Mar 2 '11 at 4:28 I
updated my answer to include that suggestion. –  Mikel Mar 2 '11
at 4:38 add comment  2 Answers  up vote 4 down vote accepted
If you put your aliases in ~/.aliases, then you can do  export
BASH_ENV="~/.aliases"  This assumes your script starts with
#!/bin/bash, because #!/bin/sh is a little less