I love sed...that being said...
I'm trying to figure out a command that will change one line, but not the comment above the line I'm changing... I know it's something simple.
# PASS_MAX_DAYS sets maximum password days
So I use:
sed '/#/!s|PASS_MAX_DAYS|PASS_MAX_DAYS 180|g' /etc/login.defs
It's working kind of... but the out put looks like this:
PASS_MAX_DAYS 180 999999
Am I missing a switch somewhere? I guess I want to replace the line and the spaces are throwing me off. Thanks again!