Skip to content

Instantly share code, notes, and snippets.

@kirkins
Created August 5, 2019 14:12
Show Gist options
  • Save kirkins/3ccf74c9cf9b2612eecb02586da5d4de to your computer and use it in GitHub Desktop.
Save kirkins/3ccf74c9cf9b2612eecb02586da5d4de to your computer and use it in GitHub Desktop.
for d in */; do
if [ $d = "unique" ]; then
echo unique
else
cp "$d"/* unique
fi
done
grep -or "$1" . | while read -r line ; do
l=$(echo "$line" | cut -d ":" -f 1)
cp "$l" result/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment