Wednesday, February 23, 2022

[SOLVED] env with variable setting and python is stuck

Issue

Not sure why but:

   /usr/bin/env IPYTHONDIR=/tmp/.ipython python

when running from command line works fine. But stuck as a shabang line:

   #!/usr/bin/env IPYTHONDIR=/tmp/.ipython python

Environment: Debian 7.8 x86

Anybody has ideas why?


Solution

Unfortunately, #! passes IPYTHONDIR=/tmp/.ipython python as a single parameter to /usr/bin/env.

One thing I have used as a workaround is to have another script that sets up variables and then invokes my real program. It is silly.

Here is some more information:

How to use multiple arguments with a shebang (i.e. #!)?



Answered By - Patrick Maupin
Answer Checked By - Dawn Plyler (WPSolving Volunteer)