Making a shorter shebang

V

veracon

Long story short, in order to use Python 2.5, I've compiled it in my
own account on my hosting. It works fantastic as
/home/my_username/python2.5, but the shebang is a bit long. Is there a
way to shorten it (environment variables?) or, even better, make
/usr/bin/env python point to it?

Thanks in advance!
 
J

Jerry

/usr/bin/env just searches your PATH variable to find it, but it does
so in order. So, if you want it to find your python instead of a
system provided one, just alter your PATH variable and put
/home/my_username/python2.5 in front of everything else.

example in .profile:

PATH=/home/<username>/python2.5:$PATH
export PATH
 
V

veracon

Thanks a lot!
/usr/bin/env just searches your PATH variable to find it, but it does
so in order. So, if you want it to find your python instead of a
system provided one, just alter your PATH variable and put
/home/my_username/python2.5 in front of everything else.

example in .profile:

PATH=/home/<username>/python2.5:$PATH
export PATH
 
V

veracon

Actually, it appears to still be using the default binary
(/usr/bin/python). Can I be sure it's actually reading the .profile
file? I'm executing through regular CGI in Apache.
 
M

Marc 'BlackJack' Rintsch

Actually, it appears to still be using the default binary
(/usr/bin/python). Can I be sure it's actually reading the .profile
file? I'm executing through regular CGI in Apache.

The `~/.profile` is executed when *you* log into your account. CGI
scripts are executed by the web server which usually has its own user and
group, `wwwrun` or something like that, and does not read the `.profile`
in your home directory.

Ciao,
Marc 'BlackJack' Rintsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top