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

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.