Advertisement

04.04.2008 at 08:33AM PDT, ID: 23296356
[x]
Attachment Details

perl substitue with colons

Asked by bt707 in Perl Programming Language

I need to reset the root password to expire in 182 days, I just want to make a backup of the shadow file and do a replace, I would think what I'm trying would work but I have something here wrong.

perl -i.bak.20080404 -e 's/^(root:.+):91:28/$1:182:28/' /etc/shadow

I tried escaping the colons but that did not help and I did not think that would be necessary here.

Thanks,Start Free Trial
[+][-]04.04.2008 at 09:14AM PDT, ID: 21283210

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.04.2008 at 09:17AM PDT, ID: 21283232

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628