Is there a way to comment/uncomment a shell/config/ruby script using command line?
for example:
$ comment 14-18 bla.conf
$ uncomment 14-18 bla.conf
this would add or remove #
sign on bla.conf
on line 14
to 18
. Normally I use sed
, but I must know the contents of those lines and then do a find-replace operation, and that would give a wrong result when the there are more than one needle (and we're only want to replace the N-th one).
sed
,perl
, etc. Specifically the A by terdon! – slm 22 hours ago