Archive

Posts Tagged ‘note to self’

Replace TODO in index files with Capitalized folder name

September 2, 2017 Leave a comment
file_name=index.html
pattern=TODO

for file_path in $(find -type f -name $file_name); do 
  dir=$(basename $(dirname $file_path))
  word=${dir^}
  sed -i -e "s/$pattern/$word/g" $file_path
done

Advertisements
Categories: bash, coding, html Tags: , ,