Ask Your Question

Curt's profile - activity

2013-06-07 06:29:09 -0600 received badge  Teacher (source)
2013-06-07 06:29:09 -0600 received badge  Necromancer (source)
2013-05-29 08:45:37 -0600 received badge  Editor (source)
2013-05-29 08:40:32 -0600 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 $@