Closed tcely closed 6 years ago
The main thrust here is argument safety. Try using a password with a space in it with your original version for instance.
The secondary objective was to run the sed program once instead of multiple times. This allows for using the backup function more easily and is going to be quicker too.
I see no reason why a password with whitespaces shouldn't work. And you also run sed
multiple times inside of the for loop.
For me, your versions adds some complexity but a good thing would be optional mysql if we include other backends.
That for loop isn't running sed, it's generating the program that sed runs after the loop.
I see no changes regarding the optimizations.
Can you explain the advantages of your changes?