Hi,
I found that the problem is because is expected that
patch --version | head -1 | cut -d ' ' -f 1
would return 'patch'
But instead it return 'GNU', because here the name id "GNU patch"
So maybe you could change de script for:
patch --version | head -1 | cut -d ' ' -f 1-2 | grep patch -o