I am trying to write the
echo "*:*:*:*:$PWD" >> $PASS
~postgres/.pgpass: No such file or directory
echo "*:*:*:*:$PWD" >> ~postgres/.pgpass
A couple of things,
~is a shell expansion.
~ doesn't extually exist as a path.
f="~/" ls $f
ls: cannot access '~/': No such file or directory
Instead, use the variable
This is a typo, you want
$HOME/.pgpass on Unix. From the pg docs on the Password File
The file .pgpass in a user's home directory or the file referenced by PGPASSFILE can contain passwords to be used if the connection requires a password (and no password has been specified otherwise). On Microsoft Windows the file is named %APPDATA%\postgresql\pgpass.conf (where %APPDATA% refers to the Application Data subdirectory in the user's profile).