if [$selection -ge 0] && [$selection -le 7] then
sqlplus sysadm/abcdefgh12@${dbarr[idx]} @/u1/scripts/ResetPswd.sql
elif [$selection == 8] then
for idx in 0 1 2 3 4 5 6 7
do
sqlplus sysadm/abcdefgh12@${dbarr[idx]} @/u1/scripts/ResetPswd.sql
done
else
exit
fi
It give me the error
`elif' unexpected
Can someone please help me? Also please let me know if the for condition is correct. for condition I meant was to execute the command for all the values (idx) 0 to 7
Can I also suggest that you take the credentials out of your sqlplus command line. Anyone running a simple ps will be able to see them whilst your database connection is active.
It might only be a short time, but if this account is a DBA (which I'm guessing that it is) then you are effectively shouting the out the number for a combination lock on your most secure safe. If no-one is listening, then you get away with it. If someone hears, it depends on their integrity if they do something with it.