
Hey David, I'm providing some information below that may be helpful, but if by "how do I fix this" you mean "how do I get my original files back" you may be out of luck unless they are backed up somewhere. What your command did was to replace any character followed by ecc with double apostrophes (''). So .ecc became '', and -ecc became '' and mecca became ''a and so on. So, if you know that the only place that the characters ecc appeared in your original file list was after a period, then you can do this to get your original text back perl -i.orig -p -e "s/''/.ecc/g;" filelist Note that I change -i to -i.orig which causes perl to save a backup of your files to name.orig Since there is no extension after the -i flag in the command below, perl does no backup the original files. For future reference, to do what you originally wanted to do, you could run this perl command perl -i.orig -p -e "s'\.ecc''g;" filelist I hope this helps, feel free to reply with questions. Jim On Wed, Jun 11, 2025 at 11:09:32PM -0400, David Mehler via Blind-sysadmins wrote:
Hello,
I've got a problem. Iwas trying to use perl to get a pattern out of a bunch of files. The pattern was .ecc wanted to replace it with nothing just remove it no extra space no nothing. My perl command was:
perl -i -p -e "s/.ecc/''/g;" filelist
Normally I use '' for my perl patterns but didn't think that would work due to the need for the period. I tried this on a copy of one of the files and it seemed to work. Trying it for real now has blown things up, the pattern is gone but I think perl added '' and/or hidden characters in the files that I am not seeing. I got a message from perl "setting locale failed. Please check that your locale settings LANGUAGE=(unset) LC_ALL=(unset) LANG = "en_us" are installed on your system" that's the gist.
When I did this I was one user and used sudo to go another in this case sudo -i.
How do I fix this?
Thanks. Dave.
-- Sent with Thunderbird
_______________________________________________ Blind-sysadmins mailing list -- blind-sysadmins@lists.hodgsonfamily.org To unsubscribe send an email to blind-sysadmins-leave@lists.hodgsonfamily.org