简体   繁体   中英

Modifying pg_hba.conf

I want to modify the line

local all all peer

to

local all all md5

within a shell script. What is the best way to go about this? If I am to search for the line, what string should I be looking for? There are a lot of spaces between each word in the pg_hba.conf

Or is there a better way at doing this?

Thank you

sed -i  '/^local all all peer/ s/peer/md5/' pg_hba.conf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM