LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-10-2006, 08:24 AM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
error when tying to run python script(bash error?)


I am going mad trying to figure this out. I have a python script that runs fine if I start it like this
Code:
python /home/shane/bin/gettorrent
but if I run it directly like this
Code:
/home/shane/bin/gettorrent
I get the following error
Code:
shane@mainbox ~ $ /home/shane/bin/gettorrent
: No such file or directory
the file is exectuable
Code:
shane@mainbox ~ $ ls -l /home/shane/bin/gettorrent
-rwxr-xr-x  1 shane users 6556 Jan  9 21:35 /home/shane/bin/gettorrent
and it starts with this
Code:
shane@mainbox ~ $ cat /home/shane/bin/gettorrent
#!/usr/bin/env python
#
# gettorrent-5b
#
import urllib, urllib2, cPickle, os, sys
I am sure I am doing something really dumb, but can't seem to see it.
 
Old 01-10-2006, 08:44 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173
do cat -vets
I bet you've got a DOS ^M at the end of the line.
if so use dos2unix to get rid of it.
 
Old 01-10-2006, 09:42 AM   #3
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
I bet you are correct, I will boot it up soon and check. I accidently erased the program off my linux box, so I copyied it over from my windows box.
 
Old 01-10-2006, 09:50 AM   #4
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
Thanks. That was the problem. I have had this problem before in the past. On occasion I will code on my windows box, then copy over to my linux box later.
 
Old 01-10-2006, 09:58 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173

yeah, I've spent a couple of days on and off wondering
why something hasn't been working. Then spent a few hours today
wondering why a server wasn't accepting connections. even did a reboot.
Then:
datalog directory 100% used!!!
solved both problems. Doh.

I should read my own signature!
 
Old 01-10-2006, 10:01 AM   #6
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
closure feels good :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
run-parts gives error on bash script ChoKamir Programming 7 08-18-2014 06:31 AM
run script error ust Linux - Software 3 01-04-2006 03:56 AM
bash script error near 'else' ? nutthick Linux - Newbie 5 01-23-2005 03:41 PM
bash script error corbis_demon Linux - Newbie 7 09-27-2004 10:41 AM
BASH script error in RH 7.3 ..whaaaa??? Pauly Linux - Software 7 12-13-2002 09:47 AM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration