The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error in if statement capri_drm Linux 16 05-14-2008 11:00 AM
Snytax error on If Statement--help dannyd_y Shell Programming and Scripting 2 05-07-2008 08:25 PM
parsing error in if statement rakeshou Shell Programming and Scripting 2 09-25-2007 07:46 AM
For loop statement - catch error lumdev Shell Programming and Scripting 4 09-20-2007 04:50 AM
tar error statement legato UNIX for Dummies Questions & Answers 3 03-29-2005 06:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-16-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 138
Arrow Error with if statement..Please help

hi,
I have a script as given below:

pr_det="1"
if[$pr_det == 1]
then
awk ' BEGIN {printf("%23s","session")}' >> report.txt
awk ' BEGIN {printf "\n"} ' >> report.txt
else
awk ' BEGIN {printf("%55s","file_dsc")} ' >> report.txt
awk ' BEGIN {printf("%101s","no_recs")} ' >> report.txt
fi

But there is some error in the script witht the if statement.
Can Someone correct it for me?
I have tried if[${pr_det} = "1"] but i got errors like this:
if[1 == 1]: command not found
syntax error near unexpected token `then'
`then'

Thanks in advance
JS
Reply With Quote
Forum Sponsor
  #2  
Old 01-16-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 138
Hi All
The error was witht tehe spacing;

Thanks
Thread closed
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0