Created
October 13, 2017 08:57
-
-
Save Komosa/d7805f5fff0e926a36ccd82d0e203ca4 to your computer and use it in GitHub Desktop.
nice awk trick
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 | |
# remove files not in arrar 'files_to_keep' | |
find -type f -name '*.bin' \ | |
| awk -v keep=" ${files_to_keep[*]} " -e 'keep !~ " "$0" "' \ | |
| xargs -L1 -I II sh -c 'git rm -f II 2>/dev/null || rm II' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment