The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-16-2008
jisha jisha is offline
Registered User
  
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 144
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