Last active
July 19, 2020 11:20
-
-
Save sk22/67f8cce206a30f434b4da6478004eec6 to your computer and use it in GitHub Desktop.
Create listing of new files (that don't already exist) from a list of files
This file contains hidden or 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 | |
while read f; do | |
# i think this regex doesn't make a lot of sense in this context - won't fix now | |
if [[ -z $(find . -name "$(echo $f | sed 's/\..*$//')*") ]]; then | |
echo $f >> new-files.txt | |
fi | |
done < files.txt |
This file contains hidden or 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 | |
while read f; do cp $f new-files/; done < new-files.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment