[Slackbuilds-users] letsencrypt updates

Ricardo J. Barberis ricardo at palmtx.com.ar
Fri Jan 19 14:48:56 UTC 2018


El Jueves 18/01/2018 a las 20:45, Eric Pratt escribió:
> for i in $(grep -ri apache2ctl * | cut -d: -f1 | sort -u)
> do
>   sed -i 's/apache2ctl/apachectl/' $i
> done

Just nitpicking, but that for can be simplified with grep's -l option:

for i in $(grep -ril apache2ctl *)
do
  sed -i 's/apache2ctl/apachectl/' $i
done


Or, if you want to include possible hidden directories/files (which * doesn't 
expand):

for i in $(grep -ril apache2ctl .)
do
  sed -i 's/apache2ctl/apachectl/' $i
done


Fixing it for paths with spaces is left as an excercise for the reader :)

Cheers,
-- 
Ricardo J. Barberis
Usuario Linux Nº 250625: http://counter.li.org/
Usuario LFS Nº 5121: http://www.linuxfromscratch.org/
Senior SysAdmin / IT Architect - www.DonWeb.com


More information about the SlackBuilds-users mailing list