Perl uncomment line

Hi guys

I am making a bash script, need to un-comment a line remove the"#"

Want to accomplish this with a Perl command.

Line is like this:

#readclients = yes

Need it like this:

readclients = yes

Any help would be really appreciated.

Hi, the syntax is as sed command for a simple case:

perl -p -e 's/#(readclients)/$1/' file

this print to screen, to modify directly file use "-i" option of perl.

Regards.

Try:

perl -i -pe 's/^#(readclients)/$1/' file
1 Like

Thank you bartus11 that really helped me out !