Skip to content

Instantly share code, notes, and snippets.

@dot
Last active October 2, 2020 06:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dot/42b1d1186e916e991b8a85ea49d03b3d to your computer and use it in GitHub Desktop.
Save dot/42b1d1186e916e991b8a85ea49d03b3d to your computer and use it in GitHub Desktop.
detect NDF file
#!/bin/sh
dir=$1
if [ ! -d "$dir" ]; then
dir='.'
fi
find "$dir" -name '*[! -~]*' | while read file
do
bstr=`basename "$file" | xxd -g1`
if [ "`echo $bstr | grep 'e3 82 9a'`" ] || [ "`echo $bstr | grep 'e3 82 99'`" ] ; then
echo $file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment