You can use it as follows:
./get-security-patch-for-moodle.sh MOODLE_31_STABLE MDL-57596 --dry-run
And if it looks Ok, just drop the "--dry-run"
Hope it helps
Btw, I think we should have some kind of Moodle core report of relevant security fixes for the current running version, and have it available for the administrator to download and apply them, similar to the way we upgrade plugins. as I hardly see anyone upgrade their entire system, which in my neighborhood... are highly customized and not easily upgradeable. (well, it is not a simple "git rebase" at least)