how will i connect postgres database from unix shell script

I have got the solution so just closing this issue.

Hi,
Could you plz forward me solution that you got.
Thanks in appreciation.

psql -h <hostname> -d <database> -U <user>

where did you get the command?