fix bashisms in patch-rework.sh script