[oclug] Script

John Gluck jgluckca at home.com
Thu Aug 2 18:21:15 EDT 2001


Hi

I looks to me what you are trying to do is create an executable script that
set an env variable and then runs python.
If that's the case, the line you propose should work except that you might
need a semi-colon after the "/fud". Also, it's good to put the
#!/bin/bash
at the beginning.

John
Don't forget to chmod your script to make it executable.

Dave Edwards wrote:

> On August  2, 2001 03:52 pm, Dave Edwards wrote:
>
> >  Could this be a
> > simpler answer to my problem?  My little script might need only the
> > line:
> >
> > /usr/bin/env PYTHONPATH=/yada:/foo/bar:/fud  python
>
> That's basically what I've now done:
> #!/bin/bash
>
> /usr/bin/env PYTHONPATH=/home/dle:and/so/on python2.1
>
> Which starts the interpreter with the right P-PATH.  However, it also
> starts the interactive interpreter when I start a prog. with it:
>
> $ /usr/local/bin/python2 demo.py
> Python 2.1 (#7, May 30 2001, 11:14:43)
> [GCC 2.95.3 19991030 (prerelease)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> []
>
> rather than start demo.py.  It also makes those handy arrow key movements
> go awry:
> >>> ^[[A^[[A^[[A^[[D^[[C^[[C^
> which they don't do when I call the interpreter directly.
>
> This looks like a problem with sub-shells or something.  I tried altering
> the script to begin with ``exec''-- no difference.  Your thoughts?
>
> Dave.
> --
> ``Science fiction and nostalgia have become the same thing.''
> --T-Bone Burnett
> PGP Public Key http://www3.sympatico.ca/amoamasam/dle-public-key.asc
> _______________________________________________
> oclug mailing list
> oclug at lists.oclug.on.ca
> http://www.oclug.on.ca/mailman/listinfo/oclug




More information about the OCLUG mailing list