This is the script i wrote and saved it as "u.sh"
--------------------------------------------------
#!/bin/bash
PGUSER=postgres
PGPASSWORD=""
export PGUSER PGPASSWORD
pg_dump bank > backup
echo "BackUp Done"| sendmail
parikshit@belgaum.tbdnet
--------------------------------------------------------------
This the output when i executed it
------------------------------------------------------------------
-bash-2.05b$ bash u.sh
': not a valid identifierPASSWORD
:command not found
pg_dump: [archchiver <db>] connection to database "bank" failed: FATAL: user "pos
" does not exist
u.sh: line 7: sendmail: command not found
: command not found
: command not found
-bash-2.05b$
----------------------------------------------------------------------
I don't know what's wrong but i can tell u when i run the following script it works fine
-------------------------------------------------------------------------------------------
#!/bin/bash
PGUSER=postgres
PGPASSWORD=""
export PGUSER PGPASSWORD
psql bank <<EOFMYSQL
vacuum analyze;
EOFMYSQL
-------------------------------------------------------------------------------------------