Ask Your Question

Curt's profile - activity

2013-06-07 13:29:09 +0100 received badge  Teacher (source)
2013-06-07 13:29:09 +0100 received badge  Necromancer (source)
2013-05-29 15:45:37 +0100 received badge  Editor (source)
2013-05-29 15:40:32 +0100 answered a question Using Sage in a Python CGI script

Unfortunately, Linux passes the entire rest of the shebang command line as a single argument to the shebang executable. Therefore, if you use "#!/usr/bin/env prog", then it's impossible to pass any arguments to prog.

My solution was to change it to

#!/usr/bin/env sage-python

and write a wrapper script called sage-python containing

exec /home/sage/sage-5.7-linux-32bit-ubuntu_12.04.2_lts-i686-Linux/sage -python $@