within shell script send expect and if else

Hi I have written one shell script , using that i am able to connect to remote machine but i have to
#!/usr/bin/expect -f
set address [lindex $argv 0]
set username [lindex $argv 1]
set password [lindex $argv 2]
set OOLpath [lindex $argv 3]
set dbusername [lindex $argv 4]
set dbpasswd [lindex $argv 5]
set tnsname [lindex $argv 6]
set recdbusername [lindex $argv 7]
set recdbpasswd [lindex $argv 8]
set rectnsname [lindex $argv 9]
spawn ssh ${username}@${address}
expect "${username}@${address}'s password:"
send -- "${password}\r"
expect "$ "
send -- "cd ${OOLpath}\r"
expect "$ "
send -- "cd Client\conf\r"
##########IF-ELSE Block

expect eof

but I need to check if one file(named parfile) is exist or not and if exist then change some parameter value

cat parfile
dbtnsname = clienttns

dbuserid = scott

dbpasswd = tiger

and if not exist then copy from some directory and then change parameter dbuserid,dbpasswd value.

Please Please help me.Thanks in advance.

Please help me..............