Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-10-2005, 12:01 PM   #1
LQ Newbie
Registered: May 2005
Posts: 1

Rep: Reputation: 0
Syntax error

I keep getting this syntax error when i try running one of my scripts.

set `cat data19`
for i in `echo $*`
echo $i>>temp$$

for k in `cat temp$$|grep -i junk`
cnt=`expr $cnt + 1`
if[`expr $cnt %2` -eq 0]
echo $k
echo $cnt
rm -f temp$$

The syntax error reads
smoke1: line 14: syntax error near unexpected token `then'
smoke1: line 14: ` then'

I have no clue what this error means

can anybody help?
Old 05-10-2005, 12:04 PM   #2
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
Pure wild-a** guess here: Do you need a space between the "if" and the open square bracket? So the line would instead be "if [ blah ]..."

Or possibly the "then" keyword isn't recognized by that particular script processor? so maybe take the "then" keyword out and try it?

Last edited by pnellesen; 05-10-2005 at 12:07 PM.


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
syntax error in C ++ mshinska Programming 3 10-07-2005 04:53 PM
c++ syntax error...HELP!! lmvent Programming 3 09-30-2005 02:40 PM
Many errors when 'make'ing (example: error: syntax error before `::' token) darkblade Linux - Software 5 03-02-2005 03:00 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
ERROR running make when installing Nvidia drivers (syntax error) randyriver10 Linux - Software 5 02-21-2004 04:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:33 PM.

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