Removing incorrect characters in files

Today I realized that in some files I used, I had a | character that provoked them to be of little use (and provoke misconfiguration on the system), so I thought of removing them in a row. The choice was obvious, use tr to remove these characters, and it was perhaps the easier to script to do:

#!/bin/bash
for e in $(grep -R "|" /var/lib/files/* | cut -d: -f1)
do
tr -d '|' < $e > $e
done

Deja un comentario