if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=/opt/app/postgresql-9.5.2 elif [ -d /usr/lib/postgresql/9.6 ] then PGDIR=/usr/lib/postgresql/9.6 elif [ -d /usr/lib/postgresql/9.5 ] then PGDIR=/usr/lib/postgresql/9.5 else echo PostgreSQL bin directory not found fi export PATH="$PGDIR/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin:$PATH"