![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| whats wrong with this code | nadman123 | Shell Programming and Scripting | 4 | 04-15-2008 05:42 PM |
| how i prepare a c++ code(c code) for implementing my own protocol format | amitpansuria | High Level Programming | 1 | 09-06-2007 08:09 PM |
| What's wrong with this code? | mmignot | Shell Programming and Scripting | 3 | 11-08-2006 03:02 AM |
| Can someone review my code tell me where I am going wrong? | chrchcol | Shell Programming and Scripting | 4 | 07-28-2006 03:54 PM |
| SSH key code versus server key code | Texan | Security | 1 | 04-12-2006 08:57 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello everyone, can somebody tell me what is wrong with this code:
Code:
while true do java myTime > myTime.log sleep 60 done ./myTime: Syntax error at line 1 : `while' is not matched. Thanks in advance! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Re: What is wrong with this code?
Quote:
|
|
#3
|
||||
|
||||
|
Is it complaining about the script you posted or the script it is running via java?
The code you posted works and gives no error on Solaris 8 (the 'java' line was not tested). I tried the code in both sh and ksh (you should post what you are coding in and the OS/version). |
|
#4
|
|||
|
|||
|
Thanks guys!
I'm working on HP-UX Release 11i: November 2000 in sh. I also tried: Code:
while : do java myTime > myTime.log sleep 60 done |
|
#5
|
|||
|
|||
|
I found the problem! I was using a scprit made in notepad. I used vi and found a bunch of funny chars. Thanks everybody.
|
|
#6
|
||||
|
||||
|
DOS/Windows text files have a Carriage Return and Line Feed at the end of the file, whereas Unix files have only a Line Feed (no carriage return). ^M is the carriage return...
See this webpage for more info: UNIX vs DOS/WINDOWS File Formats |
|
#7
|
|||
|
|||
|
Yeah ^M was what I found in the script!
|
|||
| Google The UNIX and Linux Forums |