
I agree that looping something potentially destructive is a bad idea. I tested my script on 3 files that I duplicated before I ran it "live" to be sure all was well. I had 40 files in 4 folders that I needed to rename this way and did NOT want to manually do that many.
I really discovered the power of scripting tasks when I went to work with a postgresql database. The company provided a GUI front end to the database with over 200 identical schemas. But as you might expect, it was onerous to do almost anything because the GUI made you select a field to edit - one at a time.
By learning some postgresql and using PGAdmin I was eventually able to make tens of thousands of edits within milliseconds. It really became enjoyable to take a task that could have taken weeks to complete and have it done in less than a few hours of script writing. However, I always had in mind the possibility of a typo wreaking havoc - and it did on many occasions. I was smart enough to make schema backups before hitting the "run" button!
I'm not near as well versed in Bash as I'd like but each task that I can automate leaves me with some new knowledge that I can take forward.
Thanks again for your input. It's much appreciated.
Leave a comment: