On Sep 16, 9:25 pm, Blaine wrote:
> Hello,
>
> Scripts that have "#!/usr/bin/python" at the top do not parse
> correctly. Bash treats scripts with that shebang as if they are bash
> scripts.
>
> E.g.:
> bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update
> /usr/sbin/env-update: line 6: import: comma
> I think I've discovered the problem. Someone from IRC had directed me
> here: http://bugs.gentoo.org/show_bug.cgi?id=279915
I would suggest testing with the Python binary itself in your shebang line
(e.g. #!/usr/bin/python2.6, if it's in /usr/bin) to confirm, but that looks
like it :-)
R
Blaine schrieb:
Hello,
Scripts that have "#!/usr/bin/python" at the top do not parse
correctly. Bash treats scripts with that shebang as if they are bash
scripts.
E.g.:
bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update
/usr/sbin/env-update: line 6: import: command not found
/usr/sbin/env-update
On Sep 16, 9:25 pm, Blaine wrote:
> Hello,
>
> Scripts that have "#!/usr/bin/python" at the top do not parse
> correctly. Bash treats scripts with that shebang as if they are bash
> scripts.
>
> E.g.:
> bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update
> /usr/sbin/env-update: line 6: import: comma
Blaine skrev:
I'm not sure if there is a Ctrl+Z in here... but, here's the output:
bla...@attila ~/tmp $ hexdump shebang-test
000 2123 752f 7273 622f 6e69 702f 7479 6f68
010 0a6e 6d69 6f70 7472 7320 7379 730a 7379
020 732e 6474 756f 2e74 7277 7469 2865 4822
030 6c65 6f6c 202c 6f7
On Sep 16, 10:46 pm, Steven D'Aprano
wrote:
> On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote:
> > bla...@attila ~/tmp $ cat ./shebang-test
> > #!/usr/bin/python
> > import sys
> > sys.stdout.write("Hello, world.\n")
> > bla...@attila ~/tmp $ ./shebang-test
> > ./shebang-test: line 2: import: com
assuming that ur on linux/unix
and assuming that u have shebang line as #!/usr/bin/python in ur script
set permissions like this
chmod 755 myscript.py
and then run the script as ./myscripy.py
OR
simply run the python script as "python myscript.py" at the shell prompt
(note that this doesnt need she
On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote:
> bla...@attila ~/tmp $ cat ./shebang-test
> #!/usr/bin/python
> import sys
> sys.stdout.write("Hello, world.\n")
> bla...@attila ~/tmp $ ./shebang-test
> ./shebang-test: line 2: import: command not found ./shebang-test: line
> 3: syntax error near
Chris Rebert, Rami Chowdhury:
bla...@attila ~/tmp $ which python
/usr/bin/python
Ben Finney:
bla...@attila ~/tmp $ echo $SHELL
/bin/bash
bla...@attila ~/tmp $ cat ./shebang-test
#!/usr/bin/python
import sys
sys.stdout.write("Hello, world.\n")
bla...@attila ~/tmp $ ./shebang-test
./shebang-test: li
Blaine writes:
> Scripts that have "#!/usr/bin/python" at the top do not parse
> correctly. Bash treats scripts with that shebang as if they are bash
> scripts.
When you run a file as a command, it's not Bash that decides how to run
it; the kernel has the job of understanding how to run the prog
Is it possible that python is installed not in /usr/bin but in, say, /
usr/local/bin?
I'd suggest you try 'which python' to find out where it is. On my OS
X, for instance:
$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
-
Rami Chowdhury
"Never as
On Wed, Sep 16, 2009 at 8:25 PM, Blaine wrote:
> Hello,
>
> Scripts that have "#!/usr/bin/python" at the top do not parse
> correctly. Bash treats scripts with that shebang as if they are bash
> scripts.
>
> E.g.:
> bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update
> /usr/sbin/env-update: line 6:
12 matches
Mail list logo