Skip to content

Instantly share code, notes, and snippets.

@sk22
Last active July 19, 2020 11:20
Show Gist options
  • Save sk22/67f8cce206a30f434b4da6478004eec6 to your computer and use it in GitHub Desktop.
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
#!/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
#!/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