Skip to content

Instantly share code, notes, and snippets.

@Bueddl
Last active July 14, 2017 11:28
Show Gist options
  • Save Bueddl/fac4e94cbdb7517abdd172671214c34a to your computer and use it in GitHub Desktop.
Save Bueddl/fac4e94cbdb7517abdd172671214c34a to your computer and use it in GitHub Desktop.
#!/bin/bash
author=insen
find . -type f -iname '*.gbx' -print0 |
while IFS= read -r -d $'\0' file; do
if grep -aq 'author="$author"' "$file"; then
echo "Filename: $file";
uid=$(grep -aPo 'uid="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
title=$(grep -aPo 'title="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
name_formatted=$(grep -aPo 'name="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
name=$(echo "$name_formatted" | sed -r 's/\$[a-fA-F0-9]{3}//g' | sed -r 's/\$[wibosn]//g')
author=$(grep -aPo 'author="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
echo $name \(uid: $uid\)
echo author: $author, title: $title
echo
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment