Skip to content

Instantly share code, notes, and snippets.

@compholio
Created April 1, 2019 14:00
Show Gist options
  • Save compholio/890df69c9f755e6bc8db92bef2183fae to your computer and use it in GitHub Desktop.
Save compholio/890df69c9f755e6bc8db92bef2183fae to your computer and use it in GitHub Desktop.
git grep for WCHAR strings
#!/bin/bash
PATTERN="$1"
NEW_GREP="";
for (( i=0; i<${#PATTERN}; i++ )); do
if [ "${i}" -ne "0" ]; then
NEW_GREP="${NEW_GREP},"
fi
NEW_GREP="${NEW_GREP}'${PATTERN:$i:1}'"
done
git grep "${NEW_GREP}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment