I submit that not only is this script broken, it's slow. What do you think it'll do with filenames that have spaces in them.
All of the variable expansion is quoted. Spaces don't break the script.
Don't run it with data you care about. See my earlier perl script. Yes, it
gives you some rope with which to hang yourself, but it won't do the Wrong Thing, either ;)
The perl script may over write one file with another whose contents are different. I'd consider that the Wrong Thing.
The shell script is slow, but with the "echo" line fixed, it should do the Wrong Thing in far fewer cases than the other versions posted.
-- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list