Last active
August 10, 2021 16:24
-
-
Save toonetown/b75e5c37b2ebf891da16ddc5d812f983 to your computer and use it in GitHub Desktop.
Copies a file if it is different than the target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copies a file if and only if it is different | |
if [ "$(diff -q "${1}" "${2}" 2>&1 | wc -l)" -gt 0 ]; then cp "${1}" "${2}"; fi |
As of Parallels 17, it appears that this bug has been fixed!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This can be used in conjunction with a LaunchAgent to copy/replace files when they have changed. I implemented this to work around an issue as described at https://forum.parallels.com/threads/sip-settings-not-preserved-anymore.347821/ where NVRAM.dat was getting removed.
An example LaunchAgent plist file would be: