LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-05-2005, 07:18 AM   #31
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30

I tried tail -f sample and it just printed my code to the screen. I need to execute the code. How do I do this?
 
Old 07-05-2005, 07:26 AM   #32
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
Could the problem be that you can not execute code from a telnet session?
 
Old 07-05-2005, 07:42 AM   #33
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe you could try :
sh sample
instead of:
./sample
 
Old 07-05-2005, 07:49 AM   #34
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
I tried sh sample and got the following error:

sample : 7: Syntax error: end of file unexpected (expecting "do")

What does this mean?
 
Old 07-05-2005, 07:53 AM   #35
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
That means it expects 'do' at the 7th line of sample script...
I don't see why though, is your sample script exactly the
same you posted ? Maybe add a blank line at the end
of the script ? Also did you write the script in windows ?
That does matter because windows's end of line are \r\n
while linux ones are \n
 
Old 07-05-2005, 07:59 AM   #36
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
Yes, I wrote the script in windows, notebook to be exact. I added a blank line to the end of the code and still got the same error. when I went into the text editor to add the blank line......each line of code had a ^M at the end of the line and even the blank lines had it too. I dont know if that could be the problem, but I am still getting the same error even after adding a blank line
 
Old 07-05-2005, 08:13 AM   #37
hk_linux
Member
 
Registered: Nov 2004
Location: India
Distribution: RedHat, PCQLinux, Fedora
Posts: 95

Rep: Reputation: 15
Use a text editor (like vi or emacs) and remove all the ^M and save the file.
Then execute "sample". That shud work.
 
Old 07-05-2005, 08:20 AM   #38
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
That did the trick!!! Thank you very much for your help!
 
  


Reply



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
Saving a text file as a variable and reading it every second in java script mrobertson Programming 4 03-26-2007 08:25 PM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 08:10 AM
NEED AWNSER QUICK how do I save editing a text file in Konsole? DDRfreak2 Mandriva 1 08-18-2005 06:09 PM
wiring to a text file and being able to save and add to it mrobertson Programming 1 07-27-2005 02:27 PM
Find variable in template file replace w/date+ and save as jmanjohn61 Linux - General 14 12-13-2004 06:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration