By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

Making a shorter shebang

P: n/a
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!

Oct 14 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
/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

--
Jerry

On Oct 14, 10:37 am, "veracon" <vera...@gmail.comwrote:
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!
Oct 14 '06 #2

P: n/a
Thanks a lot!

Jerry wrote:
/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

--
Jerry

On Oct 14, 10:37 am, "veracon" <vera...@gmail.comwrote:
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!
Oct 14 '06 #3

P: n/a
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.

veracon wrote:
Thanks a lot!

Jerry wrote:
/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

--
Jerry

On Oct 14, 10:37 am, "veracon" <vera...@gmail.comwrote:
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!
Oct 14 '06 #4

P: n/a
In <11*********************@h48g2000cwc.googlegroups. com>, veracon wrote:
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
Oct 14 '06 #5

P: n/a
Thanks, at least now I know I wasn't doing something wrong.

Marc 'BlackJack' Rintsch wrote:
In <11*********************@h48g2000cwc.googlegroups. com>, veracon wrote:
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
Oct 14 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.